Fix packages in broken state when /boot is full

Rikudou_Sennin asked:

I noticed that my /boot partition is full (it has only 485M) and apt failed since it cannot install new kernel.

When I do apt -f install it fails, when I try to remove one kernel via apt or dpkg it fails, too.

What is the correct way to handle this? I need to delete at least one kernel so that I can handle the rest via standard apt commands.

The server is virtual, I don’t have access to the physical machine.

My answer:

When is the last time you ran apt autoremove to clean out old unnecessary packages? This also removes old kernels which you aren’t needing anymore. This is the unfortunately neglected but necessary third step after apt update and apt upgrade.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.