deleting a linux kernel

cain

Banned
Aug 1, 2003
2,512
0
0
i did an hd-install of knoppix 3.7, but for some reason i have both the 2.4.7 kernel and the 2.6.9 kernel. how do i delete the 2.4.7 kernel? i am new to linux and dont want to screw anything up
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Buy a bigger hard drive and don't worry about the couple megs being used by a spare kernel. They can come in handy.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I'm not sure how Knoppix handles their installed kernels, if they're in the package manager or not. Run 'dpkg -l 'kernel-image*' | grep ^ii' to see if they're listed. If so just do 'dpkg -P kernel-image-<version-number>' and it'll remove them. If not, you can just delete the files by hand, which would be /boot/vmlinuz-<version>, /boot/System.map-<version> and /lib/modules/<version>. Then you'll need to remove them from grub.

A kernel and all of it's modules will probably take up around 50M of space, if you're not sure about the following I would just leave it, it's not going to hurt.
 

cain

Banned
Aug 1, 2003
2,512
0
0
linux-wlan-ng-modules-2.4.27 depends on kernel-image-2.4.27.
dpkg: error processing kernel-image-2.4.27 (--purge):
dependency problems - not removing
Errors were encountered while processing:
kernel-image-2.4.27

thats the error message, should i go ahead and delete by hand anywya?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
thats the error message, should i go ahead and delete by hand anywya?

No, you never want to delete files from a package without removing the package because you'll end up hosing your package manager database and probably reinstalling the OS.

Are you using 2.4.27 for anything at all? If not, run this instead 'apt-get remove --purge kernel-image-2.4.27'. That should print out all the packages that depend on kernel-image-2.4.27 and ask if you want to remove them as well.
 

cain

Banned
Aug 1, 2003
2,512
0
0
Originally posted by: Nothinman
thats the error message, should i go ahead and delete by hand anywya?

No, you never want to delete files from a package without removing the package because you'll end up hosing your package manager database and probably reinstalling the OS.

Are you using 2.4.27 for anything at all? If not, run this instead 'apt-get remove --purge kernel-image-2.4.27'. That should print out all the packages that depend on kernel-image-2.4.27 and ask if you want to remove them as well.

i got a bunch of stuff, and they were all dpkg warnings, the last few lines look like this

dpkg: serious warning: files list file for package `lsof' missing, assuming package has no files currently installed.
73070 files and directories currently installed.)
Removing linux-wlan-ng-modules-2.4.27 ...
Removing kernel-image-2.4.27 ...
Purging configuration files for kernel-image-2.4.27 ...
The link /vmlinuz is a dangling link
Removing symbolic link /vmlinuz
Unless you used the optional flag in lilo,
you may need to re-run lilo
rmdir: `/lib/modules/2.4.27': Directory not empty
dpkg - warning: while removing kernel-image-2.4.27, directory `/lib/modules/2.4.27/kernel/fs' not empty so not removed.


but the 2.4 kernel is gone from the list now. and so far my wireless still works. weird
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0

Not really, you need modules for each specific kernel version and in Debian they're seperate packages that depend on the kernel version they were compiled for.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
I would have been interested to see exactly how much space you saved on this. Thankfully the tech industry has blessed me with exclusive access to harddrives that are bigger than 2GB! :Q

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I would have been interested to see exactly how much space you saved on this

If he still has the window open he can paste it, apt always tells you how much space will be used/freed by an operation.

For instance, I got this today when doing an upgrade:

The following packages will be upgraded:
base-files bsdutils debhelper dvdrip gnome-panel gnome-panel-data gnumeric gnumeric-common less libasound2 libatk1.0-0 libatk1.0-data libgcrypt11 libpanel-applet2-0 lintian mount util-linux util-linux-locales vim-common
19 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.9MB of archives.
After unpacking 1004kB disk space will be freed.
 

cain

Banned
Aug 1, 2003
2,512
0
0
eh, i didnt save that much space, haha. how do i take it off of my lilo list though?
so far i have

linux
linux 2.4
linux 2.6
windows

i think for "linux", it's just 2.4
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
eh, i didnt save that much space, haha. how do i take it off of my lilo list though?

It told you in the message you may need to re-run lilo . I'm not 100% sure that will be enough though, take a look in /etc/lilo.conf and see if the kernel is really gone from that config file too.
 

Flatline

Golden Member
Jun 28, 2001
1,248
0
0
And, as always, make a backup of your lilo.conf file (or any file) before you modify it.

As an aside, Cain, I'm glad to see you were able to get your knoppix hdinstall working; was it the swap partition size problem I mentioned or something else that fixed your problem?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |