
If you have several Ubuntu machines downloading packages over the internet you can use apt-cacher-ng as a proxy to cache these packages locally. This will save bandwidth and increase the speed with which machines get packages (once they have been cached). To set this up I will install apt-cacher-ng on Ubuntu Server and then configure my Ubuntu desktop machines to use apt-cacher-ng as a proxy.
Having set a static IP address on my server installation I installed apt-cacher-ng as follows:
sudo apt-get update
sudo apt-get install apt-cacher-ng
Install nano and edit the apt-cacher-ng configuration file acng.conf:
sudo apt-get install nano
sudo nano /etc/apt-cacher-ng/acng.conf
I made the following change to acng.conf:
BindAddress: 0.0.0.0
Note that acng.conf defines the cache directory as var/cache/apt-cacher-ng/_import – we will need to create this folder later on.
Restart apt-cacher-ng:
sudo /etc/init.d/apt-cacher-ng restart
Next we can move on to the setup of client machines – this requires configuring the server as a proxy and can be accomplished with the following command:
echo 'Acquire::http { Proxy "http://<server-ip>:3142"; };' | sudo tee
/etc/apt/apt.conf.d/02proxy
Make sure that you replace <server-ip> with the static IP address of your apt-cacher-ng server.
Now that the basic setup is complete there are a few additional steps to perform – the first of which is to import any packages that the server has downloaded into the apt-cacher-ng cache.
On the server create the _import directory for the apt-cacher-ng cache:
sudo mkdir /var/cache/apt-cacher-ng/_import
Copy packages from /var/cache/apt/archives to /var/cache/apt-cacher-ng/_import:
cd /var/cache/apt/archives
sudo cp *.* /var/cache/apt-cacher-ng/_import
Give apt-cacher-ng ownership of the /var/cache/apt-cacher-ng/ and /var/cache/apt-cacher-ng/_import directories:
sudo chown -R apt-cacher-ng /var/cache/apt-cacher-ng
/var/cache/apt-cacher-ng/_import
From here we can complete our configuration using the apt-cacher-ng web based dashboard. Open a browser with the following URL:
http://<server-ip>:3142/acng-report.html
Make sure that you replace <server-ip> with the static IP address of your apt-cacher-ng server:

Apt-cacher-ng dashboard
On the apt-cacher-ng dashboard scroll down and click the Import button:

Apt-cacher-ng import
Once the import is complete you can test that everything is working by downloading the same package from multiple clients. Using the Count Data button at the top of the apt-cacher-ng dashboard you will be able to monitor the transfer statistics:

apt-cacher-ng statistics
Update:
For configuration of mobile proxy clients such as laptops see: http://pricklytech.wordpress.com/2011/03/22/ubuntu-10-4-lucid-configuration-of-apt-cacher-ng-mobile-clients/
Sources:
acidborg
Ubuntu forum
Ubuntugeek