
If you’ve got multiple machines running the same distribution, APTCacherNG allow for effortless caching of software packages.
I run various distributions, but Debian is probably near the top of that list. Between virtual and physical boxes, I probably have a dozen running Debian. Seriously.
Now, between different versions and architectures you obviously can’t reuse the same packages always; but you don’t need to worry about that. This is something you set up, and then can basically forget about.
Chances are, most instances of your OS are going to be the same version (the current stable release), and the same architecture – usually AMD64.
Not only can you save a ton of bandwidth, but you benefit even more so from the speed up. My internet is about 300 Mbps give or take, but my lan is much faster. The machine I use for caching has nvme storage set aside for the task, and thus is only limited by the speed of the network interface. Even with 1GB, I think you’ll notice a tangible improvement.
It isn’t just for Debian.
Nope, it actually can work with basically anything. I’ve gotten it to work on Alpine with no real effort. I think I may have had to change a line in the config, but it is quite easy.
Under the hood, this is really just web caching. Your clients route their requests through one central machine. Since all requests go through one server, that machine can say “Oh, I just downloaded that for so-and-so an hour ago… here you go!” and forgo an internet download in favor of re-sending the cached copy.
Good for you, you’ll see speed increase no doubt. If you have limited bandwidth, It would be worth doing for even just one or two clients. If you have more than half a dozen or so, I’d say it is a no brainier. It also lowers the strain on the mirrors, which is a good thing too — Especially if you’re in charge of taking care of a whole rack of servers, or perhaps a lab / classroom full of machines.
It’s Easy!
On the clients you have a couple options. For a fresh net-install of Debian, when you go to select the country for your mirror, you want to scroll all the way to the bottom (or top?) and you’ll find “Enter Manually”. Here, you simply furnish your aptcacherng host. In my case, “novo.lan:3142”. Then, just like with debian’s mirror, the rest of the url is the same.
For existing installs, open up /etc/apt/sources.list and replace ftp.debian.org or deb.debian.org with yourmachine.lan:3142 — don’t forget to specify that port. By default, it runs on 3142.
Learn more: https://wiki.debian.org/AptCacherNg