Ubuntu仓库ca问题

apt update时报错Certificate verification failed

具体报错信息:

Certificate verification failed: The certificate is NOT trusted.

Err:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. 
  Could not handshake: Error in the certificate verification.

E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal 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.

最近我的几个Ubuntu升级都出现了一样的问题,之前一直都是好的,看报错信息是SSL的ca证书验证失败,我用的清华镜像源,猜测可能是ca证书过期了,网上有的说重装一下ca-certificates这个软件,但是我拉软件就报错,仿佛变成了一个鸡生蛋,蛋生鸡的问题。

后来我的解决方法是,把apt源换成http协议,升级之后,ca-certificates会有一个版本的升级就自动好了。

  1. 打开/etc/apt/sources.list,把所有https的网址换成http
  2. 执行sudo apt udpate
  3. 执行sudo apt upgrade
  4. /etc/apt/sources.list之前的改动还原。
  5. 再次执行sudo apt update验证问题是否修复。

如果还不行,可以检查一下有没有安装ca-certificates这个软件,使用sudo apt install ca-certificates 安装或者sudo apt install --reinstall ca-certificates进行重装。

上一篇:算法:香槟塔


下一篇:PKI及SSL协议分析