sudo apt-get update 各種問題!(ubuntu 16.04)

不知道大家最害怕什麼linux命令,我最最最最害怕的就是 sudo apt-get update命令。我簡直遇到了各種各樣形形色色的問題,甚至有一些是網上找不到原因,最後不知道改了什麼,莫名其妙又好了的問題。氣到肝疼!

今後遇到的apt-get update 問題全都歸納總結到這裏,做個記錄,看能遇到多少!

會持續更新,一有問題就更新!

1.

E: Failed to fetch http://xxx.xxx.xxx.xxx/files/31210000008FF17B/mirror.neu.edu.cn/ubuntu/dists/trusty-updates/main/binary-amd64/Packages.bz2  
E: Failed to fetch http://xxx.xxx.xxx.xxx/files/51210000008A8BF7/mirror.neu.edu.cn/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages.bz2  
E: Failed to fetch http://xxx.xxx.xxx.xxx/files/21210000005B2D12/mirror.neu.edu.cn/ubuntu/dists/trusty-updates/universe/binary-i386/Packages.bz2  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

解決方法:

換成阿里源(額。。。其實我之前用的就是阿里源,相當於重新粘了一遍,私以爲這步沒用)

sudo apt-get clean(好像沒有成功,不過懶得管了)

sudo rm /var/lib/apt/lists/* -vf

參考博客:https://blog.csdn.net/tian_ciomp/article/details/51339635

https://blog.csdn.net/theonegis/article/details/59142193

https://blog.csdn.net/qq_35451572/article/details/79516563

https://blog.csdn.net/wang1144/article/details/51604424/

錯誤瞬間變成了如下:

W: The repository 'http://mirrors.aliyun.com/ubuntu raring Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.aliyun.com/ubuntu raring-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.aliyun.com/ubuntu raring-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.aliyun.com/ubuntu raring-proposed Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.aliyun.com/ubuntu raring-backports Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/raring/main/source/Sources  404  Not Found [IP: 111.206.4.253 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/raring-security/main/source/Sources  404  Not Found [IP: 111.206.4.253 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/raring-updates/main/source/Sources  404  Not Found [IP: 111.206.4.253 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/raring-proposed/main/source/Sources  404  Not Found [IP: 111.206.4.253 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/raring-backports/main/source/Sources  404  Not Found [IP: 111.206.4.253 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

換了個我也不知道是哪裏的源(原諒我的孤陋寡聞),竟然可以了!果然是源的問題嗎?

sudo gedit /etc/apt/sources.list

將/etc/apt/sources.list文件替換爲下面文件

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ##測試版源
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse # 源碼
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ##測試版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse

參考博客:https://blog.csdn.net/github_35160620/article/details/52115542

 

未完待續。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章