picto_welcome.png  Welcome   

picto_download.png  Get Lubuntu   

picto_help.png  Documentation   

picto_contact.png  Get Help   

Over time, the start up list (GRUB) will become longer as new kernels are added. Never remove your current kernel, else your computer will not boot up. It is also generally advised to keep the most recent, previous version in case you start to have problems.

As you are going to be issuing commands with root access, please do read RootSudo.


Get current kernel version

Start an LXTerminal session enter:

uname -r

This will report back something along the lines of 2.6.32-24-generic This is your current kernel, as you are advised to keep the most recent previous version, you will also want to keep 2.6.32-23-generic (The last digits are incremented on each release).

Remove old kernels

From your LXTerminal session enter:

dpkg -l | grep linux-image-

This will show the installed kernels. Each will have the 2.6.xx-yy numbers in them. For this tutorial I am going to assume that your system has 2.6.32-24-generic, 2.6.32-23-generic, 2.6.32-22-generic and 2.6.32-21-generic. (Obviously your system will be different). As you need to keep the current one (2.6.32-24-generic) and the most recent previous one (2.6.32-23-generic), you can remove 2.6.32-22-generic and 2.6.32-21-generic

sudo apt-get autoremove linux-image-2.6.32-22-generic linux-image-2.6.32-21-generic

You will save approximately 120Mb per kernel. The 'autoremove' based command simply removes the old kernel modules. Grub will automatically be updated to show these changes so will give fewer options when you see your Grub menu

You can now close the terminal session. Next time you start your computer the older entries will no longer be there.


purge-old-kernels script

In the bikeshed ubuntu package, there's a script called purge-old-kernels, that allows you to retain a certain number of older kernels as well as the latest, rather than purging them all.


This Ask Ubuntu question presents many ways to remove kernels, but quality of them varies.


If you got a bit carried away and deleted all the kernels, you fall into the "You did WHAT?!?!" class. You will be pleased to know that you are not the first, nor will be the last, person to do this. Get your LiveCD and head over to GRUB reports no operating system.

Lubuntu/Documentation/RemoveOldKernels (last edited 2015-05-07 11:51:39 by jarno-ilari-suni)