Select Page

Not enough free disk space on boot

by | 27 February 2017 | Linux | 0 comments

Sometimes when you want to update your Ubuntu you see this:

Not enough free disk space

Please free […] disk space on /boot


Not free disk space on boot

It means that you have old kernels on your /boot partition. You should clean system and delete old kernels. Maybe not every old kernel but some of them. I usually have two or three kernels. I never have only the newest kernel because it is possible to get problems when you have just one kernel (for instance last time I had a problem to run VirtualBox machine and I came back to the older kernel).

So let’s go! As Julian Higman wrote on his blog you should paste this command in your terminal:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Now you deleted old kernels and you can update your system. Warning! You have only current kernel. Consider my words above (about two kernels).

Follow us