How to Properly Remove Linux Kernels in Ubuntu

J.A. McLynne
It may seem that removing an extra kernel from Ubuntu Linux would be a complicated task. It is actually a simple task. But if you want to do it correctly you will need to open up a command line interface to check a few things. Here are some easy steps to clear out the extra kernels from your Ubuntu Linux computer.

First check to see how many kernels reside on your system. You can do this by opening up a terminal and typing the following commands:

cd /boot

ls -l vmlinuz*;uname -a

Here is a sample of the output from the commands:

-rw-r--r-- 1 root root 4029792 2010-11-13 08:41 vmlinuz-2.6.32-21-generic

-rw-r--r-- 1 root root 4037088 2010-10-16 19:46 vmlinuz-2.6.32-25-generic
-rw-r--r-- 1 root root 4037888 2010-11-24 08:57 vmlinuz-2.6.32-26-generic
-rw-r--r-- 1 root root 4038016 2010-12-01 19:48 vmlinuz-2.6.32-27-generic
-rw-r--r-- 1 root root 4040288 2011-01-10 20:18 vmlinuz-2.6.32-28-generic
Linux ubuntupc 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux

The ls command simply provides a directory listing, and the above output shows that there are five versions of the Linux kernel installed in this system. The uname -a command shows the current kernel that is running on the system. In this case it is version 2.6.32-28, and you will want to keep this on your system. It will also be a good idea to keep version 2.6.32.27 and version 2.6.32.26 on your system. Thus, we can delete version 2.6.32.21 and 2.6.32.25.

Removing extra Linux kernels in Ubuntu may sound like a task that should be performed by experts, but it really is a simple process. All it takes is a little familiarity with the administrative tasks menu on your Ubuntu desktop, and the Synaptic Package Manager.

On your Ubuntu desktop navigate to the Synaptic Package Manger.

System --> Administration--> Synaptic Package Manager.

From the GUI select 'Status' and 'Installed.' Then from the search, type in 'linux-image.' You will be given a list of kernels that are installed on your system, and these match the list from above. In this case you would select the check box for each kernel installation that you want to get rid of, and select 'Mark for Complete Removal.' Then select 'Apply.'

It will take about a minute to complete the remove of the extra Linux kernels. When it is finished, reboot your machine to check your results. During the reboot process you will be able to verify that the extra Linux kernels were removed at the Grub screen.

Published by J.A. McLynne

An information technology professional by trade, I enjoy cooking, reading novels, and refurbishing old computers. I also write on the side to change pace.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.