Kali VM Updates – “Not Enough Disk Space”

Obviously the solution is to increase the VM’s disk allowance, but let’s solve this another way.

Here’s the issue:

1658 upgraded, 136 newly installed, 0 to remove and 281 not upgraded.
Need to get 2,854 MB of archives.
After this operation, 1,256 MB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/.

To solve this is a simple approach: upgrade each package one at a time. The key here is to use the ‘–only-upgrade’ flag for apt in a predictable loop:

apt list --upgradable 2>/dev/null | cut -d/ -f1 | while read pkg ; do apt --only-upgrade -y install "$pkg"; apt clean all ; done

For the lazy, this starts with a list of upgradable packages, runs apt install with the –only-upgrade argument on the single package, then cleans the apt cache and moves onto the next package.