Ubuntu – apt-cacher-ng: force client on local repository

aptapt-cacher-ngpackage-management

I'm currently managing a dozen servers. apt-cacher-ng is installed on the development server to maintain the packages.

The idea is to have exactly the same version and number of packages on the production servers.

We first make the update/upgrade on the dev server, then after validating the install (which can take a few hours or a day), we make the same on the production servers.

The problem is that between the time we make the update on the dev and on the production server, versions of packages may have changed so production servers won't get the same
version of the packages.

Can I force the clients (production servers) to sync with the dev server, and not retrieve newer packages on the internet?

Or, is there any clever automated way to make sure my clients are in sync with the dev server?

Thanks for reading.

EDIT:

Found this link: debian-administration.org: Cloning a Debian system – identical packages and versions.

It partially solves my problem, but I'm still looking for an answer with apt-cacher-ng or else.

Best Answer

Have you tried putting the acng service into offline mode?

After you've updated the dev server, add offlinemode:1 to the acng config file and restart the server. It can still serve the cached content but won't retrieve any newer packages over the Internet.