Not enough space in /var/cache/apt/archives/
Solution 1:
sudo apt-get autoclean
This will delete all packages not currently installed. If that doesn't free up enough space, then use sudo apt-get clean
. This clears out all .debs
downloaded and/or installed.
But it looks like your hard disk is out of space. Seriously out of space. 61Mb is not enough for a good working system. I found 2 alternatives that can circumvent space-related problems though both might be hard to pull off when using a virtual machine. A more permanent solution would be to increase the size of your virtual machine (and I would also advise using the method that allows the machine to dynamically increase in size; VirtualBox has such a setting).
Alternative if you have a partition or external storage.
With this method you re-route the location where .deb
s are stored:
sudo mv -i /var/cache/apt /media/{dir_of_mounted_disc}
sudo ln -s /media/{dir_of_mounted_disc}/apt /var/cache/apt
Run the upgrade and install. After you are done you can switch back to normal with:
sudo apt-get clean
sudo unlink /var/cache/apt
sudo mv /media/{dir_of_mounted_disc}/apt /var/cache
Of course {dir_of_mounted_disc} needs to be changed to the name of your mounted disc.
Another alternative
This way you create a RAM disc:
sudo mkdir /media/{directory}
sudo mount -t tmpfs tmpfs /media/{directory}
sudo ln -s /media/{directory}/apt /var/cache/apt
Clean up as with the 1st alternative.
Warning this requires a large amount of RAM so may not be useable when using a virtual system.
Solution 2:
These commands will remove extra packages that are no longer required .
Open terminal (Ctrl-Alt-T) and type
sudo apt-get autoclean
sudo apt-get autoremove
Solution 3:
Whenever you install a program, the packages (.deb files) get stored in /var/cache/apt/archives
, which obviously take up space (a lot of space if there are many packages installed).
To get rid of them, use:
sudo apt-get clean
Incase you're wondering what is the difference between clean
and autoclean
, here is what the man page says:
clean: clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. APT is used as a dselect(1) method, clean is run Those who do not use dselect will likely want to run apt-get clean time to time to free up disk space.
autoclean: Like clean, autoclean clears out the local repository of package files. The difference is that it only removes package files can no longer be downloaded, and are largely useless. This a cache to be maintained over a long period without it out of control. The configuration option Clean-Installed will prevent installed packages from erased if it is set to off.