LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   removing old kernels (https://www.linuxquestions.org/questions/linux-software-2/removing-old-kernels-694045/)

sycamorex 12-31-2008 07:09 AM

removing old kernels
 
Is there any automated procedure to remove old kernels or do I just need to delete the relevant files manually? The files in question are as follows:

1. relevant files in /boot
2. relevant directories in /lib/modules
3. relevant entries of grub's menu.lst

Anything else?

thanks

acid_kewpie 12-31-2008 07:30 AM

most package management systems tend to keep TWO kernels installed at once, in case an upgrade of one dies a death and such like. if you install a third, the first will often be removed automatically, along with all files and grub entries. if you want to explicitly remove one, just uninstall the relevant deb / rpm however you see fit.

sycamorex 12-31-2008 08:02 AM

Now I'm talking about F9 which was then upgraded to F10 alpha/beta and eventually F10.
Although there are indeed only three last kernels installed, there are a lot of directories in /lib/modules:
Code:

2.6.25.10-86.fc9.i686            2.6.27-0.398.rc9.fc10.i686  2.6.27-3.fc10.i686        2.6.27.5-117.fc10.i686
2.6.25.11-97.fc9.i686            2.6.27-1.fc10.i686          2.6.27.4-47.rc3.fc10.i686  2.6.27.5-94.fc10.i686
2.6.25.14-108.fc9.i686          2.6.27.2-23.rc1.fc10.i686  2.6.27.4-58.fc10.i686      2.6.27.7-134.fc10.i686
2.6.27-0.372.rc8.fc10.i686      2.6.27.3-27.rc1.fc10.i686  2.6.27.4-68.fc10.i686      2.6.27.9-159.fc10.i686
2.6.27-0.377.rc8.git1.fc10.i686  2.6.27.3-39.fc10.i686      2.6.27.4-79.fc10.i686
2.6.27-0.382.rc8.git4.fc10.i686  2.6.27.3-44.fc10.i686      2.6.27.5-109.fc10.i686


Why weren't they removed in the same way as the kernel .rpm packages? I assume I can safely delete the unnecessary directories.

drchuck 12-31-2008 08:47 AM

If you compiled or otherwise added kernel modules after upgrading the kernel, the package manager will leave those changes in place even after it deletes everything in the original kernel package. For example, the nvidia driver, vmware driver, etc, may have been added after the fact.
Code:

du -hs /lib/modules/*
will show the size of each directory, and you will find that most of them are small. You can safely delete the old unused directories, if you are careful not to delete the current ones.

sycamorex 12-31-2008 08:54 AM

thanks, that's exactly what it was: nvidia and vmware


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