June 20, 2021

Approx local Debian apt .deb cache

This will make your other local machines download packages faster because it creates a cache of packages stored on the machine we’re going to make, then lets all your clients download from that machine, instead of going to the internet every time for each client.

It seems like it’s tricky and will break things badly, but it really won’t, and you can always change your client machines back to the way they were and nothing bad will happen

cache server setup


apt-get install approx

if you want to edit /etc/approx/approx.conf and change the repository mappings to whatever upstream debian sources, go ahead, otherwise the defaults will work.

now you have to set up your clients, which is just editing one file then running an update, so login to your client with ssh (I am using lenny in this example, change to etch/squeeze/sarge/sid/whatever, it doesn’t matter, they’ll all work) and then:


vi /etc/apt/sources.list
- comment out all lines that begin with "deb"
- add these next 4 lines after you change the server ip to the server you just set up, so 192.168.1.6 or whatever you used
- deb http://ser.ver.i.p:9999/debian/ lenny main contrib non-free
- deb-src http://ser.ver.i.p:9999/debian/ lenny main contrib non-free
- deb http://ser.ver.i.p:9999/security lenny/updates main contrib non-free
- deb-src http://ser.ver.i.p:9999/security lenny/updates main contrib non-free\
apt-get update

as you run the update you should see it trying to contact your new cache server, which will take a little bit at first, but then when you install new software it’ll be much faster, especially on the 2nd client you try to install the same package.

Leave a Reply

Your email address will not be published.