PDA

View Full Version : [SOLVED] Safely removing old kernels



tim042849
October 3rd, 2010, 07:46 PM
Using ubuntu 10.04 32-bit.
Reference: https://help.ubuntu.com/community/Grub2

At the link above I find the following statement:

Note: If you don't want all your old kernels to appear in the menu list, remove their files from /boot.

OK. Which files? To elaborate, let's take the oldest (on my machine) kernel.
Two files are listed in that entry: /boot/vmlinuz-2.6.32-21-generic
and /boot/initrd.img-2.6.32-21-generic. Which of these should I remove? Both of them? Or should I do:

rm ls *21-generic

I think there is lots of room for confusion and possible hosing of the system
:confused: at least for me.

Could something elaborate on what files should really be removed?
thanks
tim

drs305
October 3rd, 2010, 07:49 PM
I've replaced this entry as I have created a new tutorial which enhances the information I previously wrote in this post. It is found here:
HOWTO: Remove Older Kernels via GUI (http://ubuntuforums.org/showthread.php?t=1587462)

oldfred
October 3rd, 2010, 07:52 PM
We typically recommend you keep two kernels incase the newest has issues, so you can boot the previous.

Uninstall extra kernels:-------------------------
In synaptic search for linux-image to choose to delete old ones
More info in post #8
http://ubuntuforums.org/showthread.php?t=1283521

A Very Easy Alternate GUI Method - Ubuntu-Tweak
http://ubuntuforums.org/showthread.php?t=818177
http://ubuntu-tweak.com/

kernels do not take a lot of space, so if not constrained for space you can modify grub just to show two kernels and occasionally houseclean.

Partial Custom menu:
I used drs305's command to limit ubuntu entries to two, turned off os_prober so it does not look for other systems and totally customized my 40_custom.
includes line to limit display to two, also hiding of windows recovery partition
Grub 2 Title Tweaks Thread -drs305
http://ubuntuforums.org/showthread.php?t=1287602
In /etc/default/grub I added this:
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER=true
or
sudo chmod a-x /etc/grub.d/30_os-prober

tim042849
October 3rd, 2010, 08:50 PM
Thanks to drs305 for the reference to ubuntu-tweak.. I downloaded it and
used it to purge all but the two latest kernels. I noted that 'tweak' also
ran update-grub.

Thanks for the tip. Good stuff!
tim

tim042849
October 3rd, 2010, 08:51 PM
We typically recommend you keep two kernels incase the newest has issues, so you can boot the previous.

...
Good stuff also. Thanks!

hectorivand
October 3rd, 2010, 08:55 PM
You can deleted safely with GtkOrphan (http://translate.google.com/translate?hl=es&sl=auto&tl=en&u=http%3A%2F%2Fwww.techdays.com.ar%2F2010%2F09%2F0 1%2Felimina-paquetes-huerfanos-con-gtkorphan%2F)

tim042849
October 3rd, 2010, 10:23 PM
You can deleted safely with GtkOrphan (http://translate.google.com/translate?hl=es&sl=auto&tl=en&u=http%3A%2F%2Fwww.techdays.com.ar%2F2010%2F09%2F0 1%2Felimina-paquetes-huerfanos-con-gtkorphan%2F)
Getting strange performance on Opera from that link. Apparently has
something to do with the translator. I will google GtkOrphan.
thanks
tim