netselect-apt - create sources.list for the fastest Debian mirrors
automatically creates a sources.list
file for using
for the specified distribution by downloading the list of
Debian mirrors using wget
choosing the fastest servers using
, and testing the valid servers using curl
available). The output file is written to OUTFILE
The list of fastest servers is determined by checking through netselect
which servers responder faster to ICMP queries. In order to determine if the
servers are valid a connectiong using the specificied protocol (HTTP or FTP)
is done using curl
is not installed setuid, then netselect-apt
run as an administrator user (i.e. root). This is only required because the
network probes done by netselect
requires these permissions. No changes
are done to the system.
If -i INFILE
is passed netselect-apt
uses that rather than
downloading another copy to a temporary file. The file will be downloaded from
- Specify which distribution of Debian to use. By default stable is
- -a, --arch ARCH
- Use mirrors containing ARCH. By default the architecture of the
current machine is used as reported by dpkg
- -s, --sources
- While generating OUTFILE include also deb-src lines to use with
``apt-get source'' to obtain Debian source packages.
- -i, --infile INFILE
- Use INFILE instead of downloading the mirror list to a temporary
file. The file must be in the same format as mirrors_full.
- -o, --outfile OUTFILE
- Use OUTFILE instead of sources.list.
- -n, --nonfree
- Include also non-free section while generating OUTFILE.
- -f, --ftp
- Use FTP mirrors instead of HTTP and generate OUTFILE
- -O OPTIONS
- The OPTIONS provided are added, verbatim, to netselect when
it is run. Here you can provide a (quoted) list of options for
- -t, --tests hosts
- Make a short list with the number of hosts provided and use that list to
test for mirror validity. By default 10 hosts are tested.
- -c, --country COUNTRY
- Only test the sites found under the country COUNTRY (the value can
either be an ISO-3166 value or the full name of the language, in English).
When this value is set the mirror list or the INFILE will be
filtered and only the sites that are listed under the given country will
be tested. Note that restricting the search might not give the best
results, as the "fastest" mirror might not even be in the same
country as the system the program is running in.
- setting this to 1 is equivalent to --sources
- setting this to 1 is equivalent to --nonfree
is unable to work with restricted environments in which
network filtering is implemented as it relies on netselect
to find a suitable mirror. To do this, the system where the script is run
needs to have network visibility of the mirrors, as it will probe them using
is also unable to work in environments where HTTP or FTP
network connections have to be done through a proxy host, as it relies on
being able to test the validity of the remote mirrors doing direct network
connections to them.
will not check if the mirror it suggests as the
"fastest" mirror is either valid or up-to-date. It is recommended
that users that use this tool also validate that the mirrors suggested are
official mirrors and are also current.
For Debian GNU/Linux it is recommended that users review the official mirror
list at http://www.debian.org/mirror/official
as well as the mirror checker
tool at http://mirror.debian.org/status.html
(which provides information on
the up-to-dateness status of mirrors)
Avery Pennarun <email@example.com>
This manual page and program have been also enhanced by Filippo Giunchedi
<firstname.lastname@example.org> and Javier Fernandez-Sanguino