
Hi, Linux distros using the apt package management system tend to cache downloaded packages in /var/cache/apt/archives/ If you have many very similar machines set up, then you'll almost certainly have a HTTP proxy cache setup for them to retrieve packages through, to reduce huge duplication of downloads. This essentially obsoletes the /var/cache/apt/archives, though. And when you're running dozens of virtual machines, it'd be nice to avoid storing all these duplicate files. What's the right way to disable it? I see I can adjust the max size and age via the APT::Archives::Max{Age,Size} parameters, but what about just turning it off altogether? Cheers, Toby

Toby Corkindale <toby@dryft.net> writes:
Hi, Linux distros using the apt package management system tend to cache downloaded packages in /var/cache/apt/archives/
If you have many very similar machines set up, then you'll almost certainly have a HTTP proxy cache setup for them to retrieve packages through, to reduce huge duplication of downloads.
This essentially obsoletes the /var/cache/apt/archives, though. And when you're running dozens of virtual machines, it'd be nice to avoid storing all these duplicate files.
What's the right way to disable it? I see I can adjust the max size and age via the APT::Archives::Max{Age,Size} parameters, but what about just turning it off altogether?
Make it a tmpfs and reboot daily, or run "apt-get clean" daily. Dunno about disabling it entirely.

Toby Corkindale <toby@dryft.net> writes:
Hi, Linux distros using the apt package management system tend to cache downloaded packages in /var/cache/apt/archives/
If you have many very similar machines set up, then you'll almost certainly have a HTTP proxy cache setup for them to retrieve packages through, to reduce huge duplication of downloads.
This essentially obsoletes the /var/cache/apt/archives, though. And when you're running dozens of virtual machines, it'd be nice to avoid storing all these duplicate files.
What's the right way to disable it? I see I can adjust the max size and age via the APT::Archives::Max{Age,Size} parameters, but what about just turning it off altogether?
PS: if you use NFS instead of HTTP (thus, file: in sources.list), it won't cache locally.

On 30 April 2014 18:46, Trent W. Buck <trentbuck@gmail.com> wrote:
Toby Corkindale <toby@dryft.net> writes:
Hi, Linux distros using the apt package management system tend to cache downloaded packages in /var/cache/apt/archives/
If you have many very similar machines set up, then you'll almost certainly have a HTTP proxy cache setup for them to retrieve packages through, to reduce huge duplication of downloads.
This essentially obsoletes the /var/cache/apt/archives, though. And when you're running dozens of virtual machines, it'd be nice to avoid storing all these duplicate files.
What's the right way to disable it? I see I can adjust the max size and age via the APT::Archives::Max{Age,Size} parameters, but what about just turning it off altogether?
PS: if you use NFS instead of HTTP (thus, file: in sources.list), it won't cache locally.
I'm not sure how that helps, unless I'm maintaining an actual debian mirror locally? (As opposed to just caching the much smaller subset of files that my servers use)

Toby Corkindale wrote:
PS: if you use NFS instead of HTTP (thus, file: in sources.list), it won't cache locally.
I'm not sure how that helps, unless I'm maintaining an actual debian mirror locally? (As opposed to just caching the much smaller subset of files that my servers use)
Oh, yeah. I maintain a full mirror of the arches & sections I use, because it's less buggy and annoying than pissing about with partial caches.

On Thu, 1 May 2014, Toby Corkindale wrote:
On 30 April 2014 18:46, Trent W. Buck <trentbuck@gmail.com> wrote:
Toby Corkindale <toby@dryft.net> writes:
Hi, Linux distros using the apt package management system tend to cache downloaded packages in /var/cache/apt/archives/
If you have many very similar machines set up, then you'll almost certainly have a HTTP proxy cache setup for them to retrieve packages through, to reduce huge duplication of downloads.
This essentially obsoletes the /var/cache/apt/archives, though. And when you're running dozens of virtual machines, it'd be nice to avoid storing all these duplicate files.
What's the right way to disable it? I see I can adjust the max size and age via the APT::Archives::Max{Age,Size} parameters, but what about just turning it off altogether?
PS: if you use NFS instead of HTTP (thus, file: in sources.list), it won't cache locally.
I'm not sure how that helps, unless I'm maintaining an actual debian mirror locally? (As opposed to just caching the much smaller subset of files that my servers use)
I just share /var/cache/apt/archives by nfs between all my systems (and make sure you don't update 2 hosts at once unless they're different arches). -- Tim Connors

On 1 May 2014 19:47, Trent W. Buck <trentbuck@gmail.com> wrote:
Tim Connors wrote:
I just share /var/cache/apt/archives by nfs between all my systems (and make sure you don't update 2 hosts at once unless they're different arches).
Also vulnerable to same-version-different-checksum if you have >1 distro (e.g. debian & ubuntu).
Yeah, I think I'd be unlikely to take that route. Too much chance of things going wrong, esp. since automated security updates are likely to go through simultaneously on some VMs. -- Turning and turning in the widening gyre The falcon cannot hear the falconer Things fall apart; the center cannot hold Mere anarchy is loosed upon the world

Toby Corkindale <toby@dryft.net> writes:
things going wrong, esp. since automated security updates are likely to go through simultaneously on some VMs.
Not the case for unattended-upgrades -- they have a built in random idler that defaults to an even distribution between 0 and 60 minutes IIRC. The code is in /etc/cron.daily/apt and it's configured in /etc/apt/apt.conf.
participants (4)
-
Tim Connors
-
Toby Corkindale
-
Trent W. Buck
-
trentbuck@gmail.com