Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As time goes by we tend to do apt-get install and add or replace software.

Are these archived in some form or do they get auto-cleared after installation? And if it doesn't get auto-cleared, it would mean that a clean up is needed, isn't it?

Finally, if they're not auto-removed, can we reuse these packages on different machines?

share|improve this question
up vote 21 down vote accepted

The downloaded packages are stored in /var/cache/apt/archives

If you want to remove them, use sudo apt-get clean.

From man apt-get:


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/. When APT is used as a dselect(1) method, clean is run automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to free up disk space.


Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

share|improve this answer
@Sergy thanks for that input. One more thing - can I copy the downloaded files and just rerun them on another computer? thanks again! – itsols Aug 22 '12 at 3:46
Yes, I never tried that but I think that just copying the files to /var/cache/apt/archives on another machine would allow you to install them without re-downloading (it would be better if they run the same distribution, of course). Alternatively, you can set up an NFS share from where all machines will install updates – Sergey Aug 22 '12 at 3:56
"The difference is that it only removes package files that can no longer be downloaded, and are largely useless" Interesting! I would have thought it was the ones that can no longer be downloaded that you might like to keep. :) – Jazz Aug 22 '12 at 4:06
Yep, this is a bit confusing, but they're actually talking about old versions of software. After foo-1.0.2 is released, foo-1.0.1 is removed from the servers because nobody needs it anymore, when you type sudo apt-get install foo it'll download and install 1.0.2 even if 1.0.1 is in the cache. So, once it's removed from the servers, it is unlikely you'll ever need it – Sergey Aug 22 '12 at 4:14
You can need it if the new one is broken, and you can force the install of a certain version (if it's still present on the server). Anyway debian has a website with all the versions of every package. – LtWorf Feb 4 at 16:01

Your Answer


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.