debian/ubuntu のミラーをいちいちネットで探すんがだるい
sources.list の自動生成と、作成ができる netselect-apt
netselect-apt で自動生成
sudo netselect-apt -c japan -s cp /etc/apt/sources.list /etc/apt/sources.list.$(date -I)back mv sources.list /etc/apt/sources.list
インストール
sudo apt install netselect-apt
インストールが必要なのが面倒ですね。dpkg で ミラーセレクトできたらいいのに
居住国のミラーを探す。
Debian/11 で試しました。
takuya@:~$ sudo netselect-apt -c japan
Using distribution stable.
Retrieving the list of mirrors from www.debian.org...
URL transformed to HTTPS due to an HSTS policy
--2022-01-17 23:17:40-- https://www.debian.org/mirror/mirrors_full
www.debian.org (www.debian.org) をDNSに問いあわせています... 128.31.0.62, 130.89.148.77, 149.20.4.15, ...
www.debian.org (www.debian.org)|128.31.0.62|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 122479 (120K) [text/html]
`/tmp/netselect-apt.9NpgR5' に保存中
/tmp/netselect-apt.9NpgR5 100%[=================================================>] 119.61K 229KB/s 時間 0.5s
2022-01-17 23:17:41 (229 KB/s) - `/tmp/netselect-apt.9NpgR5' へ保存完了 [122479/122479]
Choosing a main Debian mirror using netselect.
(will filter only for mirrors in country japan)
Running netselect to choose 10 out of 14 addresses.
...........................................................................................................................
The fastest 10 servers seem to be:
http://mirrors.xtom.jp/debian/
http://ftp.riken.jp/Linux/debian/debian/
http://ftp.jaist.ac.jp/debian/
http://ftp.yz.yamagata-u.ac.jp/debian/
http://ftp.yz.yamagata-u.ac.jp/debian/
http://hanzubon.jp/debian/
http://ftp.yz.yamagata-u.ac.jp/debian/
http://ftp.yz.yamagata-u.ac.jp/debian/
http://ftp.nara.wide.ad.jp/debian/
http://dennou-k.gfd-dennou.org/debian/
Of the hosts tested we choose the fastest valid for http:
http://mirrors.xtom.jp/debian/
Writing sources.list.
sources.list exists, moving to sources.list.1642429063
Done.
探すとはいえ、だいたい、いつもは sakura さんにお世話になってたりするけど。。。
参考資料
https://unix.stackexchange.com/questions/431996/how-to-change-mirrors-in-sources-list-automatically