博客服务器进行apt update更新时出现故障,显示“Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake:”
完整故障代码如下:
root@ecs-x-medium-2-linux-20200315094231:~# apt-get update Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease Ign:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease Ign:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease Ign:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease Err:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443] Err:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443] Err:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443] Err:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443] Reading package lists... Done E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
更换镜像源还是报错,不断尝试,终于解决了,方法如下:
touch /etc/apt/apt.conf.d/99verify-peer.conf \
&& echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"
原因还是网络策略问题,前端可能有代理之类的东西对https进行解密和重新加密。
之后恢复正常!
root@ecs-x-medium-2-linux-20200315094231:~# touch /etc/apt/apt.conf.d/99verify-peer.conf \ > && echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }" root@ecs-x-medium-2-linux-20200315094231:~# apt-get updateHit:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB] Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [83.3 kB] Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB] Get:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse Sources [181 kB] Get:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe Sources [9,051 kB] Get:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main Sources [829 kB] Get:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/restricted Sources [5,324 B] Get:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main Sources [537 kB] Get:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted Sources [34.0 kB] Get:11 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse Sources [18.9 kB] Get:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe Sources [487 kB] Get:13 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main i386 Packages [1,589 kB] Get:14 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 Packages [2,852 kB] Get:15 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main Translation-en [523 kB] Get:16 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted i386 Packages [38.6 kB] Get:17 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted amd64 Packages [1,083 kB] Get:18 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted Translation-en [150 kB] Get:19 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe i386 Packages [1,635 kB] Get:20 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe amd64 Packages [1,866 kB] Get:21 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe Translation-en [404 kB] Get:22 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse amd64 Packages [25.7 kB] Get:23 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse i386 Packages [11.2 kB] Get:24 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse Translation-en [6,088 B] Get:25 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main Sources [10.5 kB] Get:26 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe Sources [6,600 B] Get:27 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main i386 Packages [53.3 kB] Get:28 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main amd64 Packages [53.3 kB] Get:29 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main Translation-en [14.6 kB] Get:30 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe i386 Packages [18.1 kB] Get:31 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe amd64 Packages [18.1 kB] Get:32 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe Translation-en [8,668 B] Get:33 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse Sources [10.6 kB] Get:34 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted Sources [31.1 kB] Get:35 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe Sources [309 kB] Get:36 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main Sources [290 kB] Get:37 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main i386 Packages [1,296 kB] Get:38 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 Packages [2,518 kB] Get:39 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main Translation-en [436 kB] Get:40 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted amd64 Packages [1,053 kB] Get:41 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted i386 Packages [31.9 kB] Get:42 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted Translation-en [146 kB] Get:43 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe amd64 Packages [1,253 kB] Get:44 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe i386 Packages [1,047 kB] Get:45 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe Translation-en [290 kB] Get:46 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse amd64 Packages [19.1 kB] Get:47 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse i386 Packages [6,008 B] Get:48 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse Translation-en [3,908 B] Fetched 30.5 MB in 17s (1,792 kB/s) Reading package lists... Done