In order to save some bandwidth for the servers that I have setup, I decided to install the apt-cacher-ng on my natty server box.

To start, using the command:

sudo apt-get install apt-cacher-ng

on the server that you would like to cache all the packages.

Then, configure the server itself to cache all the packages you will need to change the sources.list file from /etc/apt directory using the command below:

sudo sed -i ‘s/http:\/\//http:\/\/localhost:3142\//’ /etc/apt/sources.list

Now, start the update/upgrade/install packages on the machine. All the packages should be cached on the local and ready to be use.

From client side, where you want to take the advantage of the cached packages, run the same command except you will need to change the localhost to the first server ip address ( in my case):

sudo sed -i ‘s/http:\/\//http:\/\/\//’ /etc/apt/sources.list

Once, that is done, you can start update/upgrade/install packages onto the system. All the packages have been cached previously will be picked up by the system.

Also, you can be able to see the statistic report from your browser ( in my case):