Shared apt cache using apt-cacher-ng
Shared apt cache using apt-cacher-ng
In this short how-to i will describe how to use Shared apt cache using apt-cacher-ng. With the use of apt-cacher-ng you can safe a lot traffic since it acts like a cache proxy and will download deb packages only once.
Prerequisites:
- apt-cacher-ng (on Server)
- new config file in:
/etc/apt/apt.conf.d/01apt-cacher
on Server and Clients
Install apt-cacher-ng
Install the apt-cacher-ng software as root user on your server:
aptitude install apt-cacher-ng
Configure apt-cacher-ng
Modify file: /etc/apt-cacher-ng/acng.conf as you need it.
Create a Proxy config on your server + all sharing clients
Place a new file in your apt conf dir: /etc/apt/apt.conf.d/01apt-cacher
with following content:
Acquire::http { Proxy "http://yourServerIP:3142"; }; Acquire::https { Proxy "https://"; };
Thats it!
After that you can use apt-get or aptitude update/upgrade regulary.
The connection will now be passed through your apt-cacher-ng
proxy server instance and if there are any existing packages it will use the cached ones instead of loading them over internet again.
You can watch your apt-cacher proxy stats by entering url:
http://yourServerIP:3142/acng-report.html
into your browser.
Have fun!