One command to remove ubuntu old kernels from grub
This post was written by admin on December 27, 2009
Posted Under: General
Posted Under: General
If you are running regularly update in your system,the old kernel left behind when ubuntu installs a new linux kernel.The old kernels leave in grub menu,so grub becomes longer and longer.
You can check which kernel you are running by this command:
uname -r
Then use this command to remove unused kernels as well as in grub menu:
sudo aptitude purge ~ilinux-image-.*\(\!`uname -r`\)
If you’d like a GUI,Ubuntu-Tweak is a good choice where you can remove them from Applications->Package Cleaner->Clean Kernel
Install Ubuntu-Tweak,see:http://ubuntuguide.net/installupgrade-latest-ubuntu-tweak-in-ubuntu9-109-048-108-04
Related posts:
- New Grub Customizer with default OS/background/menu colors/resolution support
- Manually adding/removing entries to Grub 2 Menu
- How to restore Grub 2 after reinstalling Windows XP/Vista/Win7
- How to get Add/Remove app back in Ubuntu 9.10(Karmic)
- Clean up Ubuntu old grub boot menu after upgrades

Reader Comments
the command is “uname -r”. you forgot a “u” in the first code
[Reply]
Only using the command: “uname -a” i achieved the kernel.
[Reply]
Worked for me. Well, restarted fine, made a lot of space on /boot partition.
10.04, 2.6.32-23 was in use and still is
[Reply]
Worked for me as well! no problems with restarting.
++
good work!
[Reply]