Ubuntu Server No Space Left on Device Error During Kernel Upgrade/Update

This error occurs when updating Ubuntu Server when the Boot partition is full…

Problem:
dpkg: error processing archive [….linux-headers-x.y.z-aaa_b.c.?-???.???_all.deb] (–unpack):
unable to create ‘…linux-headers-???…’ (while processing …. ): No space left on device
No apport report written because the error message indicates a disk full error

Solution:

  1. dpkg -l linux-headers-\* linux-image-\* | grep ^ii

    – This shows a list of headers and images that’s currently installed and taking up space.

  2. dpkg -P linux-headers-X.Y.Z-{a,b,c,d}{,-generic}

    – This removes all the linux-headers and linux-headers-generic packages that has the version of X.Y.Z and all of the version numbers within the { }

  3. dpkg -P linux-image-extra-X.Y.Z-{a,b,c,d}-generic

    – This does the same but with linux-image-extra

  4. dpkg -P linux-image-X.Y.Z-{a,b,c,d}-generic

    – This does the same but with linux-image

  5. apt-get -f install

    – This will reinstall the update/upgrade packages that failed.

Leave a Reply

Your email address will not be published. Required fields are marked *