Debian パッケージ取得に最適なサーバーを選択する apt-spy

apt-spy のインストール

% apt-cache install -s apt-spy
% sudo apt-get install apt-spy

apt-spy の実行

% sudo apt-spy update
Password:
Updating...
Grabbing file http://http.us.debian.org/debian/README.mirrors.txt...
Update complete. Exiting.
# ls -l /var/lib/apt-spy/
total 68
-rw-r--r-- 1 root root 61517 2008-12-23 21:10 mirrors.txt
% sudo apt-spy -s US -d stable -o /etc/apt/sources.list

SERVER: ftp.us.debian.org
Benchmarking FTP...
                Downloaded 4599818 bytes in 3.11 seconds
                Download speed: 1442.89 kB/sec
Benchmarking HTTP...
                Downloaded 4599818 bytes in 7.08 seconds
                Download speed: 634.77 kB/sec
Writing new sources.list file: /etc/apt/sources.list
% less /etc/apt/sources.list
# sources.list generated by apt-spy v3.1
deb ftp://ftp.us.debian.org/debian/ stable main
deb-src ftp://ftp.us.debian.org/debian/ stable main
deb http://security.debian.org/ stable/updates main
% sudo apt-get update

sources.list に contrib と non-free を追加する

% sudo vi /etc/apt/sources.list
sources.list generated by apt-spy v3.1
deb http://ftp.us.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stable main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
% apt-get update

apt-spy の country list を確認する

-s オプションで指定する国の略称を確認する。

% less /etc/apt-spy.conf