4

I know I can't install previous version without a local copy of the archive of needed version. But today I found out something surprising: I was sure that all previous archives are stored in cache. But after I upgraded firefox from v28 to v29 and checked available versions to install, result is unexpected for me:

$ apt-cache madison firefox
firefox | 29.0+build1-0ubuntu0.12.04.2 | http://archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
firefox | 29.0+build1-0ubuntu0.12.04.2 | http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages
firefox | 11.0+build1-0ubuntu4 | http://archive.ubuntu.com/ubuntu/ precise/main i386 Packages

There is no version 28. I checked /var/cache/apt/archives, and there is actually no archive of version 28. That is sad that it is removed.

How can I prevent it from removing old archives?

2 Answers2

4

The Apt cache is managed by a daily cron job. To modify the default settings, open (as root) /etc/apt/apt.conf.d/20archive:

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

To disable the automatic removal, set the three values to 0.

See the top of of /etc/cron.daily/apt for a brief documentation of these options.

1

From man apt-get

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.

Check what the current value is with apt-config dump|grep Clean

In /etc/apt/apt.conf add:

APT::Clean-Installed "false";

Also see What is difference between the options “autoclean”, “autoremove” and “clean”?

bain
  • 12,200