E: You don't have enough free space in /var/cache/apt/archives/. root@kali:~# df -H Filesystem Size Used Avail Use% Mounted on udev 2.0G 0 2.0G 0% /dev tmpfs 406M 7.0M 399M 2% /run /dev/sda6 12G 11G 480M 96% / tmpfs 2.1G 78M 2.0G 4% /dev/shm tmpfs 5.3M 0 5.3M 0% /run/lock tmpfs 2.1G 0 2.1G 0% /sys/fs/cgroup /dev/sda8 58G 114M 55G 1% /home tmpfs 406M 37k 406M 1% /run/user/0
Fixing this largely depends on where the cruft has built up.
- Start with unnecessary packages and apt cache:
sudo apt autoremove && sudo apt autoclean df -h
duto look for cruft in
sudo du -xh --max-depth=1 /var sudo du -xh --max-depth=1 /var/log
If a lot of space is consumed by
/var/log, I usually cleanup old log files with:
# Note, change +30 to the number of days you want to keep. sudo find /var/log -mtime +30 -type f -delete
Other directories probably need to be handled differently.
- Lastly, check if running processes have a lock on files pending deletion.
sudo lsof -nP | grep '(deleted)' # If your system doesn't have lsof installed: sudo apt install lsof
If there are large files pending deletion, you may need to restart the process or daemon with the lock.
this error message showed up on a raspberry pi zero-w with fresh install of Raspbian 10 Buster:
You don't have enough free space in /var/cache/apt/archives/.
The other answers here are valid, but this fresh image had no significant previous packages for removal, so removing them didn't help.
solution (1): use raspi-config --> Advanced --> Expand Filesystem
this will expand the root filesystem to use the entire sd card.
solution (2): or from the command line:
This seems to happen quite often when using micro SD as a hard drive for Raspberry Pi.
That works for Raspberry Pi OS but if you're using your Pi for Kali you need
It seems every time I use a fresh installation of Kali for the Pi, it won't upgrade without using the command. Rarely though do I require using it on a fresh installation of Raspberry Pi OS.
When you use the Rasp Pi imager it auto partitions boot and bootxx and leaves the rest free not allocated.
The simple fix is:
- Go down to the second partition
- Click the move/resize option
- Allocate the free space to the second disk.
- Press the check at the top.
In a terminal
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade