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 normally download all .deb packages and just copy the packages from /var/cache/apt/archives directory to the rest of the computers, saving me to have to download all the updates and programs again. But since Ubuntu 11.04, the directory keeps deleting the oldest file or some kind of delete method that literally resets the amount of packages there. So then I need to download them agina on the rest of the PCs. The files stay there for a couple of days but then "magic" not there anymore after some days. So what do I need to do to tell Ubuntu NOT to eliminate any files from /var/cache/apt/archives, not even the previous versions of the same package. I do not want for it to delete anything from there.

Just to add, I install packages using aptitude or synaptic.

share|improve this question
add comment

3 Answers 3

up vote 11 down vote accepted

Take a look at /etc/apt/apt.conf.d/20archive.

In there there are a few lines used by the daily apt cron job:

APT::Archives::MaxAge "30";
APT::Archives::MinAge "2";
APT::Archives::MaxSize "500";

Those are the defaults. You should get what you want by setting all three to 0.

You can look at the headers of /etc/cron.daily/apt for more information.

share|improve this answer
add comment

This is not a direct answer to your question, but have you considered puttting something like apt-cacher-ng on one machine? It sounds like you are doing a lot of work copying when it could be done rather automatically.

All you have to do (IIRC) is install the apt-cacher-ng package on one computer, make sure port 3142 is open to your LAN if you have a firewall, and run echo "Acquire::http { Proxy \"http://<ip_of_cacher_computer>:3142\"; };" | sudo tee /etc/apt/apt.conf.d/02proxy on each client. The clients will download through the cacher computer, and if a package has ever been downloaded by one client, it will just be grabbed out of the cache instead of being redownloaded. It's a pretty automatic solution to the problem of taking a long time to download the same packages twice.

share|improve this answer
    
I voted Mark's answer as correct but you have also provided me with another very cool solution so +1 to you too. –  Luis Alvarado Jul 3 '11 at 2:10
add comment

try APTonCD to make these files more portable

share|improve this answer
add comment

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.