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 192.168.1.25

sudo -i
apt-get install apt-cacher-ng
echo 'Acquire::http { Proxy "http://192.168.1.25:3142"; };' > /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 "http://192.168.123.5:3142"; };' > /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)