Ubuntu apt update時顯示無法連接

ss
3 min readSep 25, 2018

--

就已經很忙了 公司的測試電腦還突然搞我

為了解決下面的問題花了我大概半小時, 記錄一下

W: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Cannot initiate the connection to tw.archive.ubuntu.com:80 (2001:e10:3c00:8::e274). — connect (101: Network is unreachable) [IP: 2001:e10:3c00:8::e274 80]W: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Cannot initiate the connection to tw.archive.ubuntu.com:80 (2001:e10:3c00:8::e274). — connect (101: Network is unreachable) [IP: 2001:e10:3c00:8::e274 80]W: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Cannot initiate the connection to tw.archive.ubuntu.com:80 (2001:e10:3c00:8::e274). — connect (101: Network is unreachable) [IP: 2001:e10:3c00:8::e274 80]W: Some index files failed to download. They have been ignored, or old ones used instead.

主要是連不到http://tw.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease

第一個先檢查DNS是否正常
請改用8.8.8.8

vim /etc/resolv.confnameserver 8.8.8.8

如果DNS正常 這邊就卡了一小段時間, 我最後猜是tw ubuntu的站點有問題

於是到 /etc/apt/source.list

http://tw.archive.ubuntu.com

的deb全都換成

http://archive.ubuntu.com

接著就可以apt update了

--

--