Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)

share|improve this question
What is the output of apt-config dump | grep -i clean? –  enzotib Oct 4 '11 at 16:42
Hi @enzotib, I get nothing: grzes:/home/ga# apt-config dump | grep -i clean? grzes:/home/ga# –  Grzenio Oct 5 '11 at 6:57
The question mark was not part of the command :) –  enzotib Oct 5 '11 at 6:59
Heh :) Without the question mark I get the following: APT::Periodic::AutocleanInterval "0"; –  Grzenio Oct 6 '11 at 9:16

3 Answers 3

up vote 2 down vote accepted

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.

Debian provides Cache-Limit option in APT Group in apt.conf. You can experiment with it.

man apt.conf says,

              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.conf.

APT::Cache-Limit "cache_size" Put appropriate cache size in place.

share|improve this answer
Cache-Limit controls the cache in main memory used at runtime, not the disk cache in /var/cache/apt/archives. –  Marco Sep 5 '13 at 10:30

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.

share|improve this answer

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 MaxSize

To set the size, edit or create the file /etc/apt/apt.conf.d/02periodic and add the following line:

APT::Periodic::MaxSize "<size_in_MiB>";

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).

share|improve this answer

Your Answer


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.