Wednesday, February 17, 2010

Remove old images of Linux (Ubuntu) kernel

Development of Linux is quite fast paced and new versions of kernel are released pretty frequently. I have a dual boot desktop with Ubuntu and Windows XP. With each update grub boot menu keeps on growing and I have to make Windows XP default OS as desktop is used by my 8 year son as well. Each version of kernel takes up > 100MB space, though that is not a big worry with huge storage available at much cheaper price.

The unused (older) versions of kernel can be removed safely. Usually I prefer to keep the last version along with "last - 1", to be on safer side so that I have something to fallback upon if something goes wrong with the latest kernel. To remove a version of kernel go to Synaptic Package Manager and search for linux-image and select the ones you want to remove.



You'll get an option to remove completely (Mark for Complete Removal), that will get rid of everything including configuration files used by that package. Before removing kernel make sure to not remove the current version as that will make the system unusable. Use uname -a command to know the currently used version of kernel. Output of this command looks like below on my machine-

vinod@vinod-desktop:~$ uname -a
vinod@vinod-desktop:~$ Linux vinod-desktop 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 x86_64 GNU/Linux

You can also find and remove linux-headers using this simple method.

1 Comment:

rmwlaw said...

Will this method also clean out the grub2 output on my monitor when I boot the computer?