Cache Ubuntu updates on a central network PC

This is how to use apt-cacher-ng to cache Ubuntu/Debian/Linux-Mint updates on a central LAN/Virtual PC, in case you are running multiple instances of Ubuntu on different PCs in a LAN or, if you are running them in a virtual machines.

This could help significantly with load times and leave internet bandwidth for other things, and make installing a new instance of Ubuntu on a virtual machine and updating it a much faster job.

On the central server run this, assuming its ip is

sudo -i
apt-get install apt-cacher-ng
echo 'Acquire::http { Proxy ""; };' > /etc/apt/apt.conf.d/02proxy

On every other computer you want it to use the cache on the central server:

echo 'Acquire::http { Proxy ""; };' > /etc/apt/apt.conf.d/02proxy

If, at anytime, you want to disable the cache and update using the internet directly on any single computer:

echo '' > /etc/apt/apt.conf.d/02proxy

Then you can execute the previous command any time to return using the cache.

Leave a Reply

Your email address will not be published. Required fields are marked *

(Your message will only be visible after moderation)