Save bandwidth and time with apt-proxy

If you have more than one box to update or install software with apt on, apt-proxy can save you a lot of time (and bandwidth). It runs on one box, and others are then set up to update through it. Updates are then stored on the apt-proxy box so that any others that also update can do so a lot quicker than getting them from the mirrors. It also releives a bit of the strain on the mirrors you are using. This is how to set up on ubuntu 6.0.6:


Install apt-proxy:

sudo apt-get install apt-proxy

Once installed, configure your apt-proxy config to taste:

sudo vi /etc/apt-proxy/apt-proxy-v2.conf
#This is mine, but you may want to adjust for your mirrors (its also pretty close to default):
address =
port = 9999
min_refresh_delay = 1s
timeout = 15
cache_dir = /var/cache/apt-proxy
cleanup_freq = 1d
max_age = 120d
max_versions = 3
;; Ubuntu archive
backends =
;; Ubuntu security updates
backends =

Once you have done this, adjust your other boxen so that their /etc/apt/sources.list looks similar to:

deb dapper main restricted universe multiverse
deb-src dapper-security main restricted
deb dapper-security main restricted universe multiverse

One more change needed, on the clients again, edit the /etc/apt/apt.conf file:

#Acquire::http::Proxy "false"; #This needs to be commented in ubuntu.
Acquire::Proxy "false";

After that, just apt-get update as usual, the first box should be the same as normal, but after that, you should see a massive rise in speed for the others doing the same updates.

Note that feisty doesnt have this line, but dapper does, you'll need to adjust depending on your distro (cheers miles!). You may also run into this little chestnut, also needing the apt.conf line changed or commented:

Note: I wrote this up after the fact, please leave comments if you had problems with this method and I will update.


The Ubuntu Counter Project - user number # 5498