Using apt-cacher-ng


I used approx for some years now, it worked great until it didn't work.
Now I live behind a crappy link at home, timeouts to external repos are common and approx will leave you with an empty deb file, and your apt-get client will complain :(

apt-cacher-ng is simple and it will work right away (after install), but I have many VMs and images which expect to find approx and it's URLs, I don't want to change them

Change the port to 9999 was the easy part, then i have to map the old repos to the new ones

A picture is worth a thousand words

debian http://mirrors.163.com/debian
debian-security http://mirrors.163.com/debian-security
ubuntu http://mirrors.163.com/ubuntu
ubuntu-cloud-archive http://ubuntu-cloud.archive.canonical.com/ubuntu
debian-cloud-archive http://ftparchive.gplhost.com/debian

Will map to

Remap-debsec: file:debian-security /debian-security ; http://mirrors.163.com/debian-security
Remap-deb: file:debian /debian ; http://mirrors.163.com/debian
Remap-ubu: file:ubuntu /ubuntu ; http://mirrors.163.com/ubuntu
Remap-debcloud: file:debian-cloud-archive /debian-cloud-archive ; http://ftparchive.gplhost.com/debian
Remap-ubucloud: file:ubuntu-cloud-archive /ubuntu-cloud-archive ; http://ubuntu-cloud.archive.canonical.com/ubuntu

I had to comment out the default maps as they fail for me

#Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
#Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives