Every atp command returns an avalanche of errors, I freed up some space but the package management stuff seems gone and I can’t seem to fix it. Should I fresh install?
Oof… it actually happened to me and it’s not 1 problem but 2 namely :
- you ran out of disk space while updating
- AND one of the messed up packages is one that is required for the upgrade process, e.g. curl or wget (sorry can’t recall which it actually is)
so that leaves you in a terrible stable. You can still clean up this mess BUT that’s tricky. Basically you have to
- actually find out what’s taking up space (often old kernels) or “just” give up on data temporarily (basically you move your /home, or part of it, to a USB stick) via rescue mode (you need to be familiar with the CLI) or remount the disk on another working system
- get the actually missing packages via another working system then install locally (typically
dpkgon.debfiles but NOTapt getbecause that requires connectivity and thus packages you do not have anymore) the bare minimum you need then finish the update.
For me it was on a small temporary system (e.g. RPi for HomeAssistant) so it was basically easier to recover from a recent backup after formatting.
It’s annoying but it’s actually not that bad.
Edit: clarified on the broken state and dpkg vs apt get
And this is why you want atomic updates folks…
Try cleaning up space through a live usb of any distro.
Sorry that happened to you.
The distro developers should implement a solution so that updating without enough space doesn’t break your system. They could prevent the update or at least warn you that there’s not enough space and bad things can happen.
There are warnings so my bet is that there is an edge case where
- one runs apt and receives NO warning
- the system keeps on doing other tasks, e.g. user copies a large file on the same filesystem or log files just increasing
- user runs apt upgrade BUT now apt would warn except it’s not run again
so basically concurrency that makes it unpredictable, except if apt was the only process writing on the filesystem (which it never is).
There is a set of warnings for apt which run those calculations and warn the user if there isn’t enough space.
You might have too many old kernels installed. This would potentially fill up the /boot partition. One way to check this is:
df -h
Look for the line indicating space left for /boot.
You can then get a list of the installed kernels with:
dpkg --get-selections | grep -v deinstall | grep linux-image
If you need to remove old ones, use
uname -ato identify the running kernel (should be the latest version if you’ve rebooted after the last kernel update) then remove all of the older kernel packages with:sudo apt remove -y linux-image-amd64-xxxx
More generally speaking, I think that
sudo apt autoremoveshould leave you with only the latest 2 kernel packages by default.apt autoremove says dependencies are lacking
apt --fix-broken install gives me:
method http has died unexpectedly



