• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

deleting a linux kernel

cain

Banned
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
 
Buy a bigger hard drive and don't worry about the couple megs being used by a spare kernel. They can come in handy.
 
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.
 
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?
 
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.
 
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
 
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

😛
 
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.
 
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
 
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.
 
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?
 
Back
Top