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

今天更新的時候 發現錯誤

apt update

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


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

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

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


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

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

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


使用 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

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


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

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

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


運行 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

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


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

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

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

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

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


問題解決,無下文

正文完
文章赞赏 謝謝支持
post-qrcode
 0
Implementer
版权声明:本站原创文章,由 Implementer 于2020-04-23发表,共计862字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。