TechFRP Search

Custom Search

Monday, December 20, 2010

Remove Extra Kernel Entries from Ubuntu

     Have you ever wondered how to remove extra kernel entries from Ubuntu after a kernel upgrade? That's what were going to talk about today. Ubuntu Update Manager is a great utility for keeping your system up to date with the latest in patches including upgrades of your Linux Kernel. It does this automatically for you without any further work on your part. It even goes so far as to leave the old Kernels in place if you would like to go back to them at some point. Over time though this can begin to take up space and if you use the Grub boot loader, can make your start screens very messy.

     To clean these Old kernel entries off of your hard drive and unclutter Grub's boot loader menu we'll need to go into the Synaptic Package Manager. The Synaptic Package Manager is your repository of all applications installed on your PC. From here you can add and remove applications from your PC.

     Go to the Menu called System and then Administration and finally click on Synaptic Package Manager.

     You'll be prompted for administrator "sudo" credentials. Enter your password.

     In this example we are going to remove the Linux kernel for version 2.6.32-25. To do this we'll need to find three packages to remove for version 2.6.32-25. Do not remove any other versions or any other package files than the ones for the version you want removed as it could be very bad.

     The three packages are:


     In Synaptic Package Manager enter the version number of the kernel you want to remove. In this case we'll enter "2.6.32-25". The following should be displayed.

     The three packages that make up the kernel are displayed and to further clarify I've highlighted in yellow. The Green squares also indicate that the packages are currently installed.

    To remove these packages click on the Green squares for each of the packages and select "Mark fo Removal" from the popup menu. Clicking the package "linux-headers-2.6.32-25" will also mark the "linux-headers-" for removal as well.

     Once all three packages have been marked for removal it will look like this.

     This is your last chance to make sure that the correct versions have been selected. Once you are ready simply click the "Apply" button and the 2.6.32-25 kernel will be removed. You'll be prompted to confirm, again. When ready click "Apply" again.

     If everything was successful you'll get the following screen.

     That's it. The old Linux Kernel has now been removed from you system freeing up disk space. The nice thing is that the removal of the Kernel from Synaptic Package Manager will automatically remove the entries from the Grub Boot Loader. When you reboot, Grub will now look like this.

     That's all there is to it. Just replace the kernel version number with the one you want to remove and follow the steps above.  As always, these steps have been tested in my lab setup and work correctly in my environment. If they don't work for you or you encounter problems with your PC, I take no responsibility for any problems you may encounter. That being said if you follow the steps outlined above you shouldn't encounter any problems.

     If you found this tip helpful, let me know, leave a comment. Thanks.

1 comment:

  1. Making me a happy camper. Went gradually into Ubuntu. First attempt with 8 something wasn't pretty. Now it is: 10. 4 "good buddy." Grub is good! But dual boot on the old xp box is crowded after a while. So this little clean-up scenario is the deal.

    Now to mine the rest of your info.