The Debian/Ubuntu ecosystem has Apt-Cacher and its successor Apt-Cacher-NG, a nifty tool for caching packages in a local network. This comes in very handy in setups with poor Internet bandwidth.
In the past I’ve managed to run Apt-Cacher-NG successfully on CentOS 7, to act as a proxy cache for RPM packages for OpenSUSE Leap clients. So when I have to dist-upgrade to the next version of OpenSUSE, I don’t have to download a few gigabytes for every single desktop client in the network. Instead, I only update one machine, and the other ones all grab their updates from the cache.
Apt-cacher-ng is available in EPEL for RHEL/CentOS 7, but I can’t seem to find it in EPEL for RHEL/Rocky 8.
Anyone knows if apt-cacher-ng is maintained somewhere for Rocky 8 ?
Eventually, is there some similar software adapted to the RHEL ecosystem ?
When I’ve done something like this, I just made a machine that ran squid proxy. I believe you can then edit
/etc/dnf/dnf.conf and add something like:
proxy.mydomain.com to your DNS entry, or replace with the IP address of the squid server. You can even put the proxy line in the /etc/yum.repos.d/*.repo files as well - comes in handy for example if you have something like Red Hat Satellite/Spacewalk/Uyuni/SUSE Manager and therefore may only want to use the proxy for some of the repos instead of setting globally in dnf.conf. Squid defaults to port 3128 unless you tell it otherwise. You most likely will need to tell squid in it’s configuration the minimum and max size for files to cache, if I remember correctly. As the defaults will be a little too small. I have a feeling my max size was somewhere around 500mb, or even 1gb, since some packages could be as large as this.
Whether that is an option for you or not to consider, I’m not sure. It’s less dynamic than apt-cacher-ng since that uses mDNS and therefore in theory any of the machines in your network could be the proxy. But that is how I configured it for my setup as it would then cache whatever system went via the proxy, be it Linux rpm based distros, deb based or (yeah I know) Windows.
I’ve done the squid proxy thing before as well, and it worked well. You just up the retention values for RPMs and the various index files.
Also, I used to use GitHub - open-sw/pkg-cacher: This is a transparent cache for Debian and RedHat packages (.deb and .rpm). It is based on apt-cacher available on Debian. It has been enhanced to handle RedHat repositories and files whose names are the same but the contents are different. but it seems it has fallen out of maintenance. Maybe look at that for ideas if you want to do something similar. There were some nasty bugs in it; it might be better start from scratch.