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 again on the rest of the PCs. The files stay there for a couple of days, but then "magically" it's 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 it to delete anything from there.

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

3 Answers 3


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.

  • /usr/lib/apt/apt.systemd.daily in recent ubuntus
    – Jack Wasey
    Oct 23, 2016 at 8:39

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.

  • I voted Mark's answer as correct but you have also provided me with another very cool solution so +1 to you too. Jul 3, 2011 at 2:10

try APTonCD to make these files more portable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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