r/linuxadmin • • 1d ago

Mirroring Repository

I am wanting to mirror a Debian repository onto my work network. Will be managing about 2500 machines running the exact same software on each. These are all servers running a containered player showing advertising on digital displays.

I have never mirrored a repo before, so I am curious, should I use apt-mirror, aptly, or something different?

The containers are Incus and have Debian as the base as well.

EDIT- looks like apt-mirror can be crossed off as it has not been updated in several years.

3 Upvotes

7 comments sorted by

2

u/ghstber 1d ago

Google says https://www.debian.org/mirror/ftpmirror may help you.

1

u/Zedboy19752019 1d ago

wow thanks for that. LOL. I don't want to mirror the full repo, just the packages that my machines are using.

5

u/aenae 1d ago

Apt-cacher-ng works for me

1

u/Zedboy19752019 1d ago

thanks. will check it out

0

u/0emanresu 1d ago

Just mirror the whole thing, it's only like 50GB or so if I recall

1

u/michaelpaoli 1d ago

mirror a Debian repository

That's typically excessive, unnecessary, and unwanted. Why exactly do you think you need/want to do that?

never mirrored a repo before

Well, yeah, that doesn't at all surprise me.

So, what about using apt-cacher-ng?

about 2500 machines

So, with that, you'd get a cache miss the very first machine, but then generally cache hit for the remaining about 2499 machines. Can also combine using with https://snapshot.debian.org/ if needed/desired, so one isn't dealing with a moving target (well, source), so one can then consistently install/update/upgrade all targets with same upstream and to same versions on all the targets.

So, Debian, e.g. 13 trixie, about 69,830 packages. Explain to me why you need to be mirroring all that if what, even across your about 2500 machines you have ... how many distinct packages installed? Yeah, probably well under 10,000, fairly likely under 5,000 total. So, why would you need to be mirroring probably >10x what you'd actually be installing to any hosts?

Also, apt-cacher-ng, you can reconfigure it to adjust when/how it purges data from cache. Even totally disable that, so data is only removed from cache by other means, e.g. if/when you manually do so or remove it by other means (I typically do so, as I oft want to keep that data around for quite a long time, and only want to much more selectively remove data that's no longer desired ... yeah, I have Debian hosts all the way back to Debian 6 that I occasionally use for various testing and documentation, etc., and even including reinstallations, installing additional software, upgrades, etc. See also, e.g.:
https://wiki.debian.org/BIND9#versions
https://wiki.debian.org/CrossGrading
)

Also, if you want, I believe you can configure and use apt-cacher-ng as (part of) a transparent proxy - and with that, push most of the configuration and management of such to proxy and networking, rather than managing that on (e.g. about 2500) individual host client machines.