This article was archived and may no longer be relevant.
Category: Quick Wins
Remove old kernels in Ubuntu 14.04
From time to time Ubuntu 14.04 fails to update because of insufficient space. It will show you something like this message:
Not enough free disk space
The upgrade needs a total of 101 M free space on disk '/boot'.
Please free at least an additional 24.9 M of disk space on '/boot'.
Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.
If sudo apt-get clean won’t help (which is almost never), there is only few little steps to free this space and get Ubuntu updates.
-
To know which version you currently running use this little code in command line:
uname -ror for more complete report
uname -aFor me, it is showing version
3.19.0-51-genericfor you, it can be a different version. It’s definitely not a good idea to delete this version. Remember or write this version name somewhere. -
Find all kernel versions in the system:
dpkg --list | grep linux-imageThis will print out the list of all kernel versions, currently stored or used in the system. Important are
linux-image-x.xx.x-xxitems in list. -
Now when you know what version you are currently running, and all versions in system, you can remove older versions. Starting from oldest and not deleting current. For example:
sudo apt-get purge linux-image-3.xx.x-xx-genericwhere
3.xx.x-xxyou will replace by your version. This command will ask you for admin password (sudopart of it).
If there are more than two versions, I personally leave 2 newest versions untouched. This is always enough for me to get rid of Not enough free disk space error at updating.