Ubuntu mirrors

Software

Ah juzo-kun, your Linux-tans have become the stuff of legend!

Today I needed to change apt sources on an Ubuntu server to point somewhere else, on account of an awry default mirror. Since Lucid, Ubuntu has supported the mirror method:

## /etc/apt/sources.list for Ubuntu 14.04 LTS
## Using mirror.txt pool for geographically-close servers

deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse
Github Gist

I was entirely unaware mirror had its own protocol! I’ll bet it’s reflective. Jokes aside, I swapped out my local mirror for these text files, and low and behold I was pulling packages from Optus. Half a day later, and it was iiNet.

Downloading the file directly (with http, not mirrors) resulted in this list:

http://mirror.optus.net/ubuntu/

http://ubuntu.mirror.serversaustralia.com.au/ubuntu/

http://mirror.netspace.net.au/pub/ubuntu/

http://ftp.iinet.net.au/pub/ubuntu/

http://mirror.overthewire.com.au/ubuntu/

http://ubuntu.mirror.crucial.com.au/

http://mirror.as24220.net/pub/ubuntu-archive/

http://mirror.internode.on.net/pub/ubuntu/ubuntu/

http://ubuntu.mirror.uber.com.au/archive/

http://mirror.as24220.net/pub/ubuntu/

http://mirror.aarnet.edu.au/pub/ubuntu/archive/

http://mirror.waia.asn.au/ubuntu/

http://archive.ubuntu.com/ubuntu/
Github Gist

An interesting approach. Rather than hitting the same repo each time, we’re given a pool of alternative, geographically-close servers.

Both Debian and FreeBSD take a different approach to this with redirectors. Depending on where you hit pkg.freebsd.org or http.debian.org from, you’re directed to a different server.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!