debian — поиск лучшего зеркала apt

netselect-apt

netselect-apt тестирует указанные зеркала и сохраняет лучший. Работает очень быстро.

apt-spy делал то же самое в wheezy.

Установка

root@host:/root# apt-get install netselect-apt

Help

root@host:/root# netselect-apt -h
Usage: netselect-apt [OPTIONS] [ debian_release ]
       debian_release is one of stable, testing, unstable, experimental
       or a codename etch, lenny, squeeze, wheezy, jessie, sid
Options:
   -a, --arch ARCH        Use mirrors containing arch (amd64)
   -s, --sources          Include deb-src lines in generated file (no)
   -i, --infile INFILE    Use INFILE as the input file (temp file)
   -o, --outfile OUTFILE  Use OUTFILE as the output file (sources.list)
   -n, --nonfree          Use also non-free packages in OUTFILE (no)
   -f, --ftp              Use FTP as the protocol for OUTFILE (HTTP)
   -t, --tests #          Number of hosts to test (10)
   -c, --country COUNTRY  Restrict search to servers in that country
   -d, --debug            Enable debugging

Запуск

root@host:/root# netselect-apt -c russia -t 3 -a amd64 -n jessie -o /etc/apt/sources.list.d/netselect-apt.list
Using distribution jessie.
Retrieving the list of mirrors from www.debian.org...

--2016-02-17 21:48:16--  http://www.debian.org/mirror/mirrors_full
Resolving www.debian.org (www.debian.org)... 130.89.148.14, 5.153.231.4, 2001:41c8:1000:21::21:4, ...
Connecting to www.debian.org (www.debian.org)|130.89.148.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 324168 (317K) [text language="/html"][/text]
Saving to: ‘/tmp/netselect-apt.nl8NBU’

/tmp/netselect-apt.nl8NBU               100%[===============================================================================>] 316.57K  1.25MB/s   in 0.2s   

2016-02-17 21:48:16 (1.25 MB/s) - ‘/tmp/netselect-apt.nl8NBU’ saved [324168/324168]

Choosing a main Debian mirror using netselect.
(will filter only for mirrors in country russia)
netselect: 5 (5 active) nameserver request(s)...       
Duplicate address 195.14.50.21 (http://mirror2.corbina.ru/debian/, http://ftp.corbina.net/debian/); keeping only under first name.
netselect: 3 (3 active) nameserver request(s)...       
Duplicate address 85.143.112.112 (http://ftp.ru.debian.org/debian/, http://mirror.mephi.ru/debian/); keeping only under first name.
Running netselect to choose 3 out of 7 addresses.       
...............................................................
The fastest 3 servers seem to be:

    http://mirror.yandex.ru/debian/
    http://mirror2.corbina.ru/debian/
    http://ftp.psn.ru/debian/

Of the hosts tested we choose the fastest valid for HTTP:
        http://mirror.yandex.ru/debian/

Writing /etc/apt/sources.list.d/netselect-apt.list.
Done.

Результат

root@host:/root# cat /etc/apt/sources.list.d/netselect-apt.list
# Debian packages for jessie
deb http://mirror.yandex.ru/debian/ jessie main contrib non-free
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
# deb-src http://mirror.yandex.ru/debian/ jessie main contrib non-free

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

Leave a Reply