Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to know how the download cache works. Is it possible to clear this space, or does this happen automatically?

In my understanding:
The download cache is where program files are downloaded before they are actually installed onto the computer. Once the "download" file is "installed" then the file in the download cache is no longer needed. Is this correct?

share|improve this question

1 Answer 1

When a .deb package is retrieved to be installed (either as a new package or to upgrade the current version), it is stored in /var/cache/apt/archives. These packages are not needed after installation, but if you keep them, and you need to reinstall a package, then it doesn't have to be retrieved again.

You can delete these files manually but there is very little reason to do so, as there are better, automatic ways to do it.

If you want to delete all of them, run:

sudo apt-get clean

If you want to delete just the ones that are quite unlikely to be needed again, run:

sudo apt-get autoclean

Specifically, what autoclean does is to delete just the ones that are no longer provided for download. These versions are, generally speaking, sufficiently old and not recommended for use, that you usually won't want to reinstall to them.

Since the effect of autoclean depends on what packages are available for installation, you may want to update your local information about that first:

sudo apt-get update

If you want to delete specific ones, then it would make sense to manually remove the ones you don't want. You can do that with this method, though if you're comfortable with the command line then this would probably be faster, easier, and (since you don't have to worry about a root Nautilus window you might forget to close, or in which you might make a mistake with the mouse) less daunting:

cd /var/cache/apt/archives
sudo rm file1 file2 ...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.