For the command line, you can use a Python tool called apt-smart

A usage example that lets you list ranked mirrors within your country (automatically detect):

$ apt-smart -l

With -l , or --list-mirrors , you will get ( example output from Travis CI U.S. server ):

--------------------------------------------------------------------------------------------------------- | Rank | Mirror URL | Available? | Updating? | Last updated | Bandwidth | --------------------------------------------------------------------------------------------------------- | 1 | http://mirrors.gigenet.com/ubuntua... | Yes | No | Up to date | 1.73 MB/s | | 2 | http://mirror.genesisadaptive.com/... | Yes | No | Up to date | 1.68 MB/s | | 3 | http://ubuntu.mirrors.tds.net/pub/... | Yes | No | Up to date | 1.4 MB/s | | 4 | http://repos.forethought.net/ubuntu | Yes | No | Up to date | 1.35 MB/s | | 5 | http://repo.miserver.it.umich.edu/... | Yes | No | Up to date | 937.62 KB/s | ... | 75 | http://mirror.cc.vt.edu/pub2/ubuntu | Yes | No | 1 day behind | 659.67 KB/s | | 76 | http://mirror.atlantic.net/ubuntu | Yes | No | 2 days behind | 351.26 KB/s | | 77 | http://mirror.lstn.net/ubuntu | Yes | No | 4 days behind | 806.81 KB/s | | 78 | http://mirrors.usinternet.com/ubun... | Yes | No | 4 weeks behind | 514.31 KB/s | | 79 | http://mirrors.arpnetworks.com/Ubuntu | Yes | No | 19 weeks behind | 418.94 KB/s | | 80 | http://mirrors.ocf.berkeley.edu/ub... | Yes | Yes | Up to date | 446.07 KB/s | --------------------------------------------------------------------------------------------------------- Full URLs which are too long to be shown in above table: 1: http://mirrors.gigenet.com/ubuntuarchive 2: http://mirror.genesisadaptive.com/ubuntu 3: http://ubuntu.mirrors.tds.net/pub/ubuntu 5: http://repo.miserver.it.umich.edu/ubuntu ... 78: http://mirrors.usinternet.com/ubuntu/archive 80: http://mirrors.ocf.berkeley.edu/ubuntu

Of course, apt-smart can also change your sources.list if you want to:

$ apt-smart -a

With -a , or --auto-change-mirror to discover available mirrors, rank the mirrors by connection speed and update status and update /etc/apt/sources.list to use the best available mirror.

With -c , or --change-mirror MIRROR_URL to update /etc/apt/sources.list to use the given MIRROR_URL.

Compared with other tools:

apt-smart automatically finds where you are so you don't need to specify the country when you travel abroad.

automatically finds where you are so you don't need to specify the country when you travel abroad. apt-smart does real HTTP download from each mirror to get more accurate results ( bandwidth & status ) and supports HTTP proxy, rather than using ping and relying on launchpad 's inaccurate data.

does real HTTP download from each mirror to get more accurate results ( bandwidth & status ) and supports HTTP proxy, rather than using and relying on launchpad 's inaccurate data. apt-smart is being maintained, whereas most other tools leave issues unfix for a long time.