Boot partition is 100% full. Cant remove old packages to make space [duplicate]

Solution 1:

Give the package manager some working room by zeroing some old initrd..., vmlinuz..., and System.map... file. Assuming you are running on vmlinuz-4.4.0-70, keep all the ...70 files and the previous kernel, the ...66 files. If ...70 is not the kernel you are running, then keep the one you are running too. Now you can use an echo command to zero the files you don't want e.g.:

sudo echo >/boot/initrd.img-4.4.0-51-generic
sudo echo >/boot/vmlinuz-4.4.0-51-generic
sudo echo >/boot/vmlinuz-4.4.0-51-generic.efi.signed  
sudo echo >/boot/System.map-4.4.0-51-generic
sudo echo >/boot/abi-4.4.0-51-generic

etc.
When you have some space, try the previously suggested purge/remove commands.

Simply removing the files will cause the package manager to panic, and refuse to do anything, but a zero length file is acceptable, so it should complete. Looks like you have piled up a whole queue of things to install, they may refill the /boot. Be prepared to do more zeroing if that happens.


If you should delete a file that you wanted by accident, the package should still be around, and may be restored with another install or reconfigure.


The downloaded packages are put into directory /var/cache/apt/archives, so if your missing file has its package there, try

 sudo dpkg-reconfigure thepackage

There are a variety of other suggestions above to clean up, but worst case, you might have to create the empty files needed, purge the package, then just install it again.

Solution 2:

The boot partition is full of the old linux releases. I had the same issue about a month ago because I was lazy about autoremove.

sudo apt-get autoremove

Will clean up everything that's not needed any longer, including those. Only after you have cleaned up some space, will apt work to fix or install other things.

After running the above command, I was then able to do:

sudo apt-get install -f

And then finally update and upgrade with

sudo apt-get update
sudo apt-get upgrade