In 2005, I wrote a short article on how to delete old kernels in Linux. At that time, I was using Fedora exclusively. Since then, I’ve moved on to Ubuntu. In addition, Grub2 is now standard for all Ubuntu releases. This short article will show you how to remove old kernels in your Linux system as well as clean up your Grub2 entries. By the way, you will see Grub2 entries only if you have a multi-boot configuration. If not, Ubuntu will boot directly to the login screen.
First, determine the current kernel being used by typing the following command in the Terminal.
# uname -r
The result will display something like the one below.
Now, it’s important not to delete your current kernel because all hell will break loose or the sky will fall on your head. In either case, you don’t want to be in that predicament.
You can use the ‘Synaptic Package Manager’ to remove the older kernels. Use ‘2.6.32’ to narrow down your search. Right click on the kernel you want removed and choose ‘Mark for Complete Removal.’ After all older kernels are removed, you can now update the Grub2 configuration.
# sudo update-grub
That’s it. The next time you boot your multi-boot Ubuntu system, you will see less entries in Grub as well as successfully have deleted older kernels you no longer needed. There is a more detailed instruction how to remove other entries in Grub from howtogeek.com.