This quick tip shows you how to remove old kernels from an Ubuntu install.
If you have been using Ubuntu for some time then you must have witnessed a Linux Kernel update. When you update the Linux Kernel, the older version still stays in the system and takes some of the disk storage.
Removing the old kernels is one of the many ways to free disk space in Ubuntu.
Apart from disk space, old Linux kernels also clutter the Grub boot menu (newer Grub is cleaner as it groups all the older Linux Kernels together).
Whatever may be the reason if you want to get rid of the older unused Linux kernel versions, follow this simple tutorial.
Method 1: Remove old kernels from Ubuntu using command line
This is the easiest possible option. All you have to do is to use the command below:
sudo apt autoremove
This apt command removes all the unnecessary packages that are not required anymore. This includes the older Linux kernel versions. In fact, this command is one of the best ways to make free space on Ubuntu.
Method 2: Remove old kernels using Software Center [Not Recommended]
This method was written when the autoremove command didn’t remove Linux kernel versions and you would see a number of Linux kernels in the Grub menu. You don’t need it anymore.
uname -r
The output should contain something like 3.5.0-16-generic. This number is my current Linux version. This kernel MUST NOT be deleted. In fact, I would suggest you to keep at least one older version in case you may need it.
Now, open Ubuntu Software Center. Search for linux-image. Don’t worry if there are no search results. At the bottom of the panel, click on Show XX technical items:

This will show you the list of Linux Kernels installed in your Ubuntu system. Select any of them and click on Remove to uninstall it.

And that is it. Now update Grub in Ubuntu to refresh it by using the following command in terminal:
sudo update-grub
Just a reboot here.
I hope this quick tip helped you in removing old kernels from Ubuntu. If you have questions or suggestions, do let me know in the comments.
Hi Abhishek,
On switching my computer back on (Ubuntu 20.04) after a power cut, grub came up and showed several old kernels present! I use auto-remove all the time so I was surprised to see them. Came to itsfoss.com and tried your method but when I go to the software centre it just states ‘no application found’ and there is no box in the bottom left hand corner.
Is there a different way of doing it in 20.04?
Thanks a lot for all your valuable tips and how-toos. I use them all the time.
Hello Simon,
Normally, there should be at least one older kernel present in the system so that you could switch to that one in rare conditions.
How many older kernels do you see? And what versions are they?
Hi Abhishek.
Since your blog helped me (a lot) in one of your posts, I feel like I must contribute.
My solution for this is not in graphic user interface, but in CLI, which is part of my job. I wrote this solution in my own company’s blog: http://opsctec.blogspot.com.br/2013/04/remocao-dos-arquivos-de-kernel-antigos.html
Since it is written in portuguese (I am from Brazil), I’ll give here exactly what is needed, in English. Please, when you can take a look at some of my posts. Obviously, you’ll need a translator.
I assume your user is in sudoers file, and you are using Ubuntu 10.04 or newer.
Solution 1) how to remove all old kernel stuff:
Copy this and paste on a terminal:
sudo apt-get remove –purge $(dpkg -l | egrep -i ‘linux-.*-(([0-9])+.){2}[0-9]+-[0-9]+-‘ | grep -v $(uname -r) | awk ‘{print $2}’); sudo apt-get autoremove -y
Solution 2) how to remove one or more kernel stuff interactively:
Copy this and paste on a terminal:
select i in $(dpkg -l | egrep -i ‘linux-.*-(([0-9])+.){2}[0-9]+-[0-9]+-‘ | grep -v $(uname -r) | awk ‘{print $2}’); do sudo apt-get remove $i –purge; done
I hope it can be useful, and if so, please make know in my blog.
Hi Gilbert…
Thanks for the tip.
You can send your articles in English via mail, and I’ll publish it under your name.