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.

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

1 Answer 1

up vote 13 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

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.

autoclean

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
1  
@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

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.