This is a known problem: /boot will run out of space after some time, due to obsolete kernel images. It will only become evident when /boot is on a separate filesystem, as it is the case for encrypted systems.

Can anyone confirm whether this has (finally!!) been fixed in 14.04? If so, ignore the rest of this post.

Otherwise. Please let us find a solution for this ridiculous design error.

The general recommendation is to run a chain as follows:

1.) dpkg --get-selections to get all installed packages 2.) grep out kernel images 3.) remove the current kernel from the list, based on uname -r 4.) run apt-get remove on the remaining ones

This may be OK if run semi-automatically. But I need it to run completely unattended, alongside completely unattended system upgrades. (Because I'm preparing a system for a non-tech person who has better things to do than to care about old kernel images.)

In combination with an unattended system upgrade, the following could happen (I imagine):

1.) let the current kernel be version N 2.) a new kernel is installed, say version M 3.) the above procedure is run, but uname -r still gives version N, so version M is removed again 4.) FAIL

One idea of mine was to sort the list of kernels lexicographically and then remove all but the, say, last 2 in the list. (And also remove the one given by uname -r from the list.) This way the latest kernels would never be removed. That is, IF lexicographical ordering puts the latest kernel last. Which, by looking at past package names, appears probably not to be the case. m(

So the next idea is to write a more sophisticated kernel version parser.

Any ideas? Has anyone already implemented a working solution?

Thank you!

  • One way to manage this is to use the GUI with Ukuu and then it can handle the deleting and you can choose which Kernels to delete (auto-deleting is not simple because if something breaks your kernel you'll want to be able to boot into an old one) - I agree you don't need 10 old ones though! Mar 21, 2018 at 11:11

1 Answer 1


My permanent solution to this is to not have /boot be a separate partition. This hasn't been necessary for a long time, back when BIOS could only read the first 1024 cylinders on a disk it was important, but not now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.