[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What do folks use to mirror repositories



On 4/15/22 04:36, tomas@tuxteam.de wrote:
On Fri, Apr 15, 2022 at 07:03:14AM -0400, Sam wrote:
That's pretty much it. I want to mirror all my updates to a single server on
my LAN and have everything on my LAN apt update from it. This seems more
efficient than having everyone download their own copies.

If all you are looking for is efficiency, you might also consider an
apt cache (I'm pretty happy with apt-cacher-ng). It is pretty low
maintenance, as it decides itself when to throw out older entries.

The big plus for me is that it can cache across multiple repos (I
sometimes build "old" images from archives.d.o for some legacy
hardware hidden away in some customer's closets, don't ask ;-)
It just does so silently. Whenever the package isn't there, it
fetches it, next time it's served from the cache.

Another nice point is that you can just keep your /etc/apt/sources.list
as it should be (with the "real" repo addresses out there) and the
apt cache works as a proxy. An entry in (e.g.) /etc/apt/apt.conf.d/02cache
like so:

   # /etc/apt/apt.conf.d/02cache
   #
   Acquire::http::proxy "http://localhost:3142";

(or whatever your apt cache's URL is) suffices -- something you can
easily disable or remove should you ever "release" your pet machine
"into the wild" :-)

Google told me to use apt-mirror [...]

A mirror has different characteristics from a cache. You decide
yourself which packages go in. This may be an advantage, depending
on your use case -- or a disadvantage.


When I had several Debian machines in the past, I used approx(8) [2]. It was good software -- KISS, properly documented, easy to set up, worked efficiently, and never failed.


But approx(8) had some operational features that apt-cacher-ng(8) [3] seems to improve upon:

1. Each host needed its apt(8) [1] configuration to point at the approx(8) server.

2. The approx(8) server needed its configuration to point at the remote repositories.

3. I seem to recall that I was able to use approx(8) with non-Debian repositories via creative configuration.

4. The approx(8) cache needed to be thinned periodically by running approx-gc(8) [2].


David


References:

[1] https://manpages.debian.org/buster/apt/apt.8.en.html

[2]  https://manpages.debian.org/stretch/approx/approx.8.en.html

[3] https://manpages.debian.org/unstable/apt-cacher-ng/apt-cacher-ng.8.en.html



Reply to: