I'd like to know if there is an official way to rescue from a botched install due to filled disk space. Working with VMs and trying to conserve space on golden images has led me to this problem several times. I can usually remedy it by using ncdu -x /
and deleting unneeded files, but apt install ncdu
has to installed beforehand. I've also used journalctl --vacuum-size=5M
to reduce the system log file. Or using apt purge *<old kernel number>
, but again that wont work once the apt install process is broken.
This one suggests finding and deleting the packages that installed.
https://www.cyberciti.biz/howto/debian-linux/ubuntu-linux-rollback-an-apt-get-upgrade/
This post suggests using apt clean
and apt install -f
to repair the database. I'm not sure apt clean work with apt broken and apt purge showing apt --fix-broken install
. apt install -f
seems to retry with force the pending install.
Disk space issue after apt-get update
I actually just checked and apt clean
does in fact work and restores some disk space. It seems that using apt purge <package>
after clearing some space with apt clean
is the only way to get back to the state before the broken install.
It would be great if Apt would say to "use apt clean if the disk is full", which it could check. It could also check for enough free space before allowing non-forced install.