LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Removing an old kernel from my system (https://www.linuxquestions.org/questions/linux-newbie-8/removing-an-old-kernel-from-my-system-710388/)

GGlinux 03-09-2009 09:48 PM

Removing an old kernel from my system
 
Hi Everyone I have just compiled a new kernel version (the latest) over an old centos kernel so I can have access to the latest kernel features. Problem is that I still have the old kernel on my HD.

What is the cleanest way of removing the old kernel without killing my linux system?

jamescondron 03-09-2009 10:12 PM

So long as your grub conf/ lilo conf is set up to see both kernels, remove it- so long as you boot with the new one, the old one can be done with what you want. Saying that, though, why bother? Why not keep the old one as a stable one, or even use it to make changes to in a risk free environment (you don't want to hose your only kernel, of course)

jschiwal 03-09-2009 10:56 PM

I second the advice to keep the old version around. It you had an even older one, you could edit grub to delete the stanza for it; delete the kernel & initrd and the modules in /lib/modules/<old_version>/.
You may also have the source tree for that version as well that you don't need.

GGlinux 03-09-2009 11:43 PM

Quote:

Originally Posted by jamescondron (Post 3470343)
So long as your grub conf/ lilo conf is set up to see both kernels, remove it- so long as you boot with the new one, the old one can be done with what you want. Saying that, though, why bother? Why not keep the old one as a stable one, or even use it to make changes to in a risk free environment (you don't want to hose your only kernel, of course)

Well the reason I want to remove it entirely is because it is an image i need to deploy to over 100 sites and because I have two kernels, the image size is over 2 gigs. I want to be able to get the size as small as possible and the kernel as clean as possible.

frieza 03-10-2009 12:32 AM

i doubt the kernel is at fault there
my comp has 3 kernels installed, between the contents of my /boot partition and /lib/modules it is < 300 megs combined for ALL 3
but if you need to get rid of an older kernel, simply remove the entry in /boot/grub.conf (or menu.lst, which i find is often just a symlink to grub.conf anyways, remove the relevant vmlinux,System.map, and initrd files, then remove the relevant directory from /lib/modules
or if it was installed using the system's package manager just use the package manager's 'uninstall' feature
although imho this seems pointless because the slight increase in space doesn't seem to me to justify sacrificing having a 'lifeboat' handy in case something goes wrong with your current kernel
fedora seems to leave 3 or 4 versions of the kernel installed 'just in case'

as they say, fortune favours the prepared mind ;)


All times are GMT -5. The time now is 06:51 PM.