Removing old or unwanted kernels from Ubuntu
If you install a kernel update in Ubuntu then the old version will usually be retained so that you can boot it if something goes wrong with the new kernel.
This approach is good for system recovery purposes but it can cause problems for users with limited disk space, such as netbook users. It can also result in a cluttered boot menu if you are using the standard automatically generated GRUB menu.
This guide explains how to uninstall old or unwanted kernels.
Warning
This process is potentially risky - you could accidentally delete a kernel you need and end up with an unbootable system. Only try this if you have limited disk space or a particularly cluttered automatically generated boot menu. If you do proceed then ensure that you backup before proceeding.
Determining which version to keep
The first step is to determine which version you want to keep. This is usually the latest version and, assuming you haven't changed the GRUB configuration (including menu.lst) or compiled custom kernels, the one you are running.
You can check which kernel you are running by going to "System->Administration->System Monitor" and choosing the "System" tab. In this example the kernel version is "2.6.31-15-generic".
Removing other versions
You can now remove the unwanted kernels by uninstalling the appropriate packages. This guide uses Synaptic, but other package managers should work fine.
Start Synaptic by going to "System->Administration->Synaptic Package Manager". Click on the Search button and enter "linux-image-". You should then see a list of kernels. The ones with green squares are installed.
For each kernel you want to remove click on the green square next to it and choose "Mark for removal" from the list of options. Ensure that you don't remove the one you want to keep from above - you should have at least one "linux-image" still green when you've done.
If you want to free more space you can repeat the above process for the "linux-headers" package.
When you're certain you have the right packages selected choose Apply. Review the list of changes and click OK.
The kernels will now be uninstalled. The GRUB menu should be automatically updated.

