Debian: using netselect-apt to find the fastest archive mirror

If you need to quickly find the fastest Archive mirror to download Debian packages, you can either use apt-spy as shown here or use a tool called netselect-apt.

netselect-apt can be installed with apt-get:

# apt-get install netselect-apt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  netselect
The following NEW packages will be installed:
  netselect netselect-apt
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.9 kB of archives.
After this operation, 171 kB of additional disk space will be used.
Do you want to continue [Y/n]? 
Get:1 http://ftp.de.debian.org/debian/ squeeze/main netselect amd64 0.3.ds1-14+squeeze1 [25.8 kB]
Get:2 http://ftp.de.debian.org/debian/ squeeze/main netselect-apt all 0.3.ds1-14+squeeze1 [12.0 kB]
Fetched 37.9 kB in 0s (201 kB/s)         
Preconfiguring packages ...
Selecting previously deselected package netselect.
(Reading database ... 106538 files and directories currently installed.)
Unpacking netselect (from .../netselect_0.3.ds1-14+squeeze1_amd64.deb) ...
Selecting previously deselected package netselect-apt.
Unpacking netselect-apt (from .../netselect-apt_0.3.ds1-14+squeeze1_all.deb) ...
Processing triggers for man-db ...
Setting up netselect (0.3.ds1-14+squeeze1) ...
Setting up netselect-apt (0.3.ds1-14+squeeze1) ...

You can then start it with the distribution (e.g. stable, testing, unstable, lenny, squeeze…) as parameter:

# netselect-apt stable
Using distribution stable.
Retrieving the list of mirrors from www.debian.org...

--2012-12-25 21:20:46--  http://www.debian.org/mirror/mirrors_full
Resolving www.debian.org... 86.59.118.148, 2001:858:2:2:214:22ff:fe0d:7717
Connecting to www.debian.org|86.59.118.148|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 337765 (330K) [text/html]
Saving to: “/tmp/netselect-apt.UJfxkZ”

100%[==================================================================================================================================================================>;] 337,765     1.68M/s   in 0.2s    

2012-12-25 21:20:46 (1.68 MB/s) - “/tmp/netselect-apt.UJfxkZ” saved [337765/337765]

Choosing a main Debian mirror using netselect.
netselect: 389 (23 active) nameserver request(s)...       
Duplicate address 212.36.0.70 (http://ftp.bg.debian.org/debian/, http://debian.spnet.net/debian/); keeping only under first name.
...
Duplicate address 128.61.240.89 (http://128.61.240.89/debian/, http://debian.gtisc.gatech.edu/debian/); keeping only under first name.
Running netselect to choose 1 out of 379 addresses.      
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
The fastest server seems to be:
        http://debian.cruisix.net/debian/

Writing sources.list.
Done.

It is much faster than apt-spy and produces a sources.list file in the current directory:

# cat ./sources.list 
# Debian packages for stable
deb http://debian.cruisix.net/debian/ stable main contrib
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
# deb-src http://debian.cruisix.net/debian/ stable main contrib

# Security updates for stable
deb http://security.debian.org/ stable/updates main contrib

netselect-apt is faster than apt-spy but supports less option and it is e.g. not so easy to select a region or country.

netselect-apt is also faster because it doesn’t actually benchmark the mirrors but just pings them. So the speed measurements made by netselect-apt are not as accurate as the one done by apt-spy.

Another difference is that netselect-apt automatically gets the latest list of archive mirror. With apt-spy you’d need to first run it with the update option.

One thought on “Debian: using netselect-apt to find the fastest archive mirror

  1. Pingback: 使用NTP同步时间 | Tanky Woo

Leave a Reply

Your email address will not be published. Required fields are marked *