报错提示
执行sudo apt-get update时,报错如下 … Ign:188 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/multiverse Translation-en Ign:189 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata Ign:190 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/multiverse DEP-11 64x64 Icons Err:121 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/main amd64 Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none Ign:122 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/main i386 Packages Ign:123 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/main Translation-en
…
Reading package lists… Done W: The repository ‘https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial 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 ‘https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-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 ‘https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-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. W: The repository ‘https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-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. E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-backports/restricted/binary-amd64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial/main/binary-amd64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-updates/main/binary-amd64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-security/main/binary-amd64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Some index files failed to download. They have been ignored, or old ones used instead.
解决方法
step 1
将 /etc/apt/sources.list 中的https 都替换成 http,我使用的是清华源,ubuntu16.04,修改后如下
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
step 2
sudo apt-get update sudo apt-get upgrade
step 3
把step 1的修改复原即可,复原后如下
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
|