1. 程式人生 > >sudo apt-get update 各種問題!(ubuntu 16.04)

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

錯誤瞬間變成了如下:

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

未完待續。。。