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:
- Clean up cache,useless file/kernel to free disk space by Ubuntu-Tweak
- Manually adding/removing entries to Grub 2 Menu
- How to get Add/Remove app back in Ubuntu 9.10(Karmic)
- How to restore Grub 2 after reinstalling Windows XP/Vista/Win7
- StartUp Manager-An GUI tool for managing Grub,Usplash and Splashy

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]