Categories: DebianHow-ToLinux

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!

Jules

Jules is the owner and author of ISPIRE.ME. He's a Linux System Engineer, Tech fanatic and an Open Source fan.

Share
Published by
Jules

Recent Posts

HTTP/2 SSL Offloading with Hitch and Varnish

HTTP/2 SSL Offloading with Hitch and Varnish Since Chrome browsers showing you insecure warning on…

7 years ago

File changed as we read it GlusterFS issue

File changed as we read it GlusterFS issue Recently i had trouble running Backups of…

7 years ago

Running multiple instances of varnish using systemd

Running multiple instances of varnish using systemd If you have not yet found a complete…

7 years ago

HTTP/2 SSL Offloading with Haproxy and Nginx

HTTP/2 SSL Offloading with Haproxy and Nginx After HTTP/2 becoming more an more prominent regarding SSL…

7 years ago

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for Everyone knows the Problem. Get…

7 years ago

Review TDS2 How to backtest using tick data with Metatrader 4

Review TDS2 How to backtest using tick data with Metatrader 4 in this Review TDS2…

8 years ago

This website uses cookies.