This is how I set up apt-cacher-ng. I decided to write this out so I can remember how I did it, & because some other tutorials I tried to use had mistakes. It saves you from having to download the same package from repositories on different machines on a lan.
First install the package:
sudo apt-get install apt-cacher-ng
Then, if you need it, more documentation is available in your browser @:
file:///usr/share/doc/apt-cacher-ng/html/index.html
You'll need the server to have a static IP address on your lan. Mine's 192.168.1.100
Setup the Server:
Make a file: /etc/apt/apt.conf.d/02proxy
Put the following line in it:
Acquire::http { Proxy "http://localhost:3142"; };
Go to:
http://localhost:3142/acng-report.html
You should see: Apt-Cacher NG maintenance page for ~Your Desktop's Name Here~
Setup the Client:
sudo gedit /etc/apt/apt-conf.d/02proxy
Put the following line in it:
Acquire::http { Proxy "http://192.168.1.100:3142"; };
Now you should be able to download a package on the server, & once then clients will be able to get it from there.
If you want to import packages you downloaded prior to installing apt-cacher-ng so that they'll also be available, use sudo nautilus to copy everything in /var/cache/apt/archives to /var/cache/apt-cacher-ng/_import (you'll have to make _import)
Then run:
chown -R /var/cache/apt-cacher-ng /var/cache/apt-cacher-ng/_import
Go to:
http://localhost:3142/acng-report.html & click on the import button at the bottom of the page.
You need to configure the server and one client before doing the import. See above for instructions.
Run "apt-get update" on client(s) once to teach ACNG about remote locations of (volatile) index files.
Somehow this isn't perfect. I updated the server's packages, then a client's. The client downloaded some packages from the server, but not all. Anyway, I'm happy enough for now.
Bookmarks