如何在 Ubuntu Linux 上選擇最快的 apt 鏡像

今天更新的時候 發現錯誤

apt update


我懷疑是我的網絡問題,所以就 ping,結果發現不是,可能是鏡像服務器問題

ping hk.archive.ubuntu.com
ping cn.archive.ubuntu.com


手動獲取當地鏡像 list,有了列表我應該如何做呢?

wget -qO- mirrors.ubuntu.com/mirrors.txt


使用 netselect 選擇最快的鏡像,由於 Ubuntu 沒有這個源,所以需要手動

wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-26_amd64.deb
dpkg -i netselect_0.3.ds1-26_amd64.deb


運行 netselect 獲得結果 (粉紅色是結果)

netselect -s 20 -t 40 $(wget -qO - mirrors.ubuntu.com/mirrors.txt)


運行 netselect 獲得結果 (粉紅色是結果)

netselect -vv ftp.cuhk.edu.hk www.ubuntu.org.tw hk.mirrors.thegigabit.com mirror.xtom.com.hk mirror.as.kamatera.com mirror-hk.koddos.net


最後就是修改 sources.list 以及 update

sed -i 's/http:\/\/hk.archive.ubuntu.com\/ubuntu\//http:\/\/mirror.xtom.com.hk\/archive\//' /etc/apt/sources.list
apt update

可以參考我的博文:如何修改 sources.list

[v_act]Ubuntu mirror "The Chinese University of Hong Kong" https://launchpad.net/ubuntu/+mirror/ftp.cuhk.edu.hk-archive[/v_act]


問題解決,無下文

版权声明:
作者:Implementer
链接:https://www.ianext.com/%e5%a6%82%e4%bd%95%e5%9c%a8-ubuntu-linux-%e4%b8%8a%e9%81%b8%e6%93%87%e6%9c%80%e5%bf%ab%e7%9a%84-apt-%e9%8f%a1%e5%83%8f/
来源:粵分享越快樂
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>