Upgrading Multiple Debian Machines Quickly With approx
One Download Feeds Them All
April 16, 2009
If you have multiple Debian machines to administer, approx can
help you get them updated and upgraded more quickly and using less bandwidth.
approx is an archive/proxy server for Debian repositories, fetching
packages on demand and caching them locally. This means that you only have to
grab the package once for your entire local network: after that, other
machines can get it from the approx server.
Install the package on the machine you want to use as a server, via
apt-get with sudo apt-get install approx. Once it's
installed, edit /etc/approx/approx.conf to set your repository names:
On your client machine, edit /etc/hosts to set localproxy to the IP address of your server:
Then edit /etc/apt/sources.list to work via the server:
deb http://approx:9999/debian stable main non-free contrib
deb-src http://approx:9999/debian etch main non-free contrib
deb http://approx:9999/security stable/updates main non-free contrib
deb-src http://approx:9999/security etch/updates main contrib non-free
deb http://approx:9999/non-us stable main non-free contrib
Note: you could avoid editing /etc/hosts and just use the name or IP
address of your approx server directly in
/etc/apt/sources.list. Doing it this way means that if you move
the server, you need to edit only a single line in /etc/hosts on each
machine. If you use LDAP or similar for local lookup, even better!
Finally, restart the approx server with /etc/init.d/approx
restart, and run apt-get update on the client machine. Note
that initially you may get time-out problems: Try again if you need to. After
the first run, subsequent runs should be much faster.