sudo apt update報錯

在Ubuntu系統下,使用sudo apt-get update有時會出現「W: 沒法下載 http://cn.archive.ubuntu.com/ubuntu/.... 校驗和不符」,ubuntu

xj@xjVir:~/test$ sudo apt-get update 獲取:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
獲取:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
獲取:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [573 kB]
獲取:4 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [404 kB]
錯誤:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease 
  鏈接超時 [IP: 91.189.91.24 80] 獲取:5 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] 
忽略:4 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages 
獲取:6 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [190 kB]
獲取:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB]
獲取:8 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]
獲取:9 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]
錯誤:5 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease 
  鏈接超時 [IP: 91.189.91.24 80] 獲取:10 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
獲取:11 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [13.2 kB]
獲取:12 http://security.ubuntu.com/ubuntu bionic-security/restricted i386 Packages [4,280 B]
獲取:13 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [4,292 B]
獲取:14 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [621 kB]
忽略:14 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
獲取:15 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [597 kB]
錯誤:10 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease
  鏈接超時 [IP: 91.189.91.26 80] 獲取:16 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [207 kB]
忽略:16 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en
獲取:17 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB]
獲取:18 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
獲取:19 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [111 kB]
獲取:20 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages [4,292 B]
獲取:21 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [5,904 B]
獲取:22 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2,568 B]
獲取:23 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
獲取:24 http://security.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 48x48 Icons [29 B]
獲取:25 http://security.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 64x64 Icons [2,638 B]
獲取:4 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [404 kB]
獲取:14 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [621 kB]
獲取:16 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [207 kB]
已下載 2,987 kB,耗時 5分 3秒 (9,868 B/s) 正在讀取軟件包列表... 完成 W: 沒法下載 http://cn.archive.ubuntu.com/ubuntu/dists/bionic/InRelease 鏈接超時 [IP: 91.189.91.24 80]
W: 沒法下載 http://cn.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease 鏈接超時 [IP: 91.189.91.24 80]
W: 沒法下載 http://cn.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease 鏈接超時 [IP: 91.189.91.26 80]
W: 部分索引文件下載失敗。若是忽略它們,那將轉而使用舊的索引文件。

解決方法以下:sudo gedit /etc/apt/sources.listionic

而後將 文件中http://cn.archive.ubuntu.com/ubuntu/url

替換爲http://mirrors.163.com/ubuntuhttp://mirrors.sohu.com/ubuntuspa

再次sudo apt-get update。.net

如若還出現相似的問題,建議多嘗試更換,部分用163,部分用sohu。

rest

其餘引用:https://www.jianshu.com/p/c7c12939917dcode

相關文章
相關標籤/搜索