I have 2 systems running Debian at home and I am trying to minimize the bandwidth use while upgrading the packages. How can I increase the size limit of the cache, so that I could just copy the packages over LAN? (currently they get removed too quickly)
The size limit is controlled by the apt option
APT::Periodic::MaxSize. You can display your current value using the following command:
apt-config dump | grep Periodic
To set the size, edit or create the file
/etc/apt/apt.conf.d/99local-archive and any of the following lines:
APT::Periodic::MaxSize "<size_in_MiB>"; APT::Periodic::MaxAge "<days>"; APT::Periodic::MinAge "<days>";
/etc/cron.daily/apt for comments on available options, and the transition from
APT::Archives::*. (Ubuntu 14.04 ships
/etc/apt/apt.conf.d/20archive which sets
APT::Archives::MaxSize. When they transition to
APT::Periodic in that file, it will matter that you put your local changes in a file with a higher number.)
This sets the maximum size of the cache in MiB. If the cache is bigger, cached package files are deleted until the size requirement is met (the biggest packages will be deleted first).
Make sure to do this on all machines that mount the directory.
You should consider using a separate caching proxy for your apt instances. apt-proxy is one tool you could try. Let that do the caching and prune the individual apt archives more aggressively.
To set the cache size for apt, you need to edit
apt.conf. You can get information on how to configure it in
man apt.conf. If it is not already present create it in
/etc/apt/apt.conf or you may need to edit
/etc/apt/apt.conf.d/70debconf file, please refer specific version's documentation.
Cache-Limit option in APT Group in
apt.conf. You can experiment with it.
man apt.conf says,
Cache-Limit APT uses a fixed size memory mapped cache file to store the 'available' information. This sets the size of that cache.
So you need to put following line in
APT::Cache-Limit "cache_size" Put appropriate cache size in place.