Skip to main content

Ubuntu Archive Mirror reporting tool for apt sources configuration

Project description

Find a fast, up-to-date Ubuntu Archive Mirror.


  • Tests latency to mirrors in mirrors.txt.
    • 3 requests are sent to each mirror, minumum round trip time being used for rank.
  • Reports latency, status, and bandwidth capacity of the fastest mirrors in a ranked list.
    • Status and bandwidth are scraped from launchpad.
  • Generates sources.list file using new mirror.
    • New mirror can be chosen from a list or selected automatically using the top ranked mirror (default).


Target most recent release:

pip install apt-select


pip3 install apt-select


easy_install apt-select

Target project master branch:

pip install git+


git clone
python apt-select/ install


$ apt-select --help
usage: apt-select [-h] [-t NUMBER] [-m STATUS | -p] [-c | -l]

Find the fastest Ubuntu apt mirrors.
Generate new sources.list file.

optional arguments:
  -h, --help            show this help message and exit
  -t NUMBER, --top-number NUMBER
                        specify number of mirrors to return
                        default: 1
  -m STATUS, --min-status STATUS
                        return mirrors with minimum status
                        default: up-to-date
  -p, --ping-only       rank mirror(s) by latency only, disregard status(es)
                        cannot be used with -m/--min-status
  -c, --choose          choose mirror from a list
                        requires -t/--top-num NUMBER where NUMBER > 1
  -l, --list            print list of mirrors only, don't generate file
                    cannot be used with -c/--choose


Choose from the top 3 mirrors, including those last updated a week ago::

apt-select -c -t 3 -m one-week-behind

Find the top 10 mirrors, output latency info only, and don’t generate new config file::

apt-select -t 10 -p -l

After new sources.list is generated in current working directory, backup and replace to update apt::

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
sudo mv sources.list /etc/apt/

Supported URI Types

Currently, http and ftp are supported.

/etc/apt/sources.list should contain sources in the following format::

[deb|deb-src] [http|ftp]:// [component1] [component2] [...]


Python HTML parser, BeautifulSoup.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for apt-select, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size apt_select-1.0.1-py2.py3-none-any.whl (14.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page