借鉴他人文章

https://blog.csdn.net/q965844841qq/article/details/121482942

问题

在将ubuntu18.04更换为清华源一段时间后,使用apt-get install 安装qtcreator时候,遇到如下错误

忽略:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu groovy-updates/universe amd64 apt-transport-https all 2.1.10ubuntu0.3
错误:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu groovy-updates/universe amd64 apt-transport-https all 2.1.10ubuntu0.3
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/a/apt/apt-transport-https_2.1.10ubuntu0.3_all.deb: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/a/apt/apt-transport-https_2.1.10ubuntu0.3_all.deb: No system certificates available. Try installing ca-certificates.
E: 无法下载 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/a/apt/apt-transport-https_2.1.10ubuntu0.3_all.deb Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?

重点报错是:

The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification.

以及warning 提示,可能是证书失效了

Try installing ca-certificates.

通过 apt-get install ca-certificates --reinstall 无法更新安装包。

手动下载 ca-certificates deb 文件重新安装最新版。文件来自:

https://pkgs.org/download/ca-certificates

打不开可以使用镜像源:

http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates/

***选择对应的ubuntu版本号!敲重点!***选择对应的.deb文件,下载
版本号

关于怎样查看ubuntu版本号,详见这篇文章

https://blog.csdn.net/weixin_49700990/article/details/122005001

下载结束后,拖入虚拟机的/tmp目录下(这个行为需要虚拟机安装VMware Tools)
而后使用如下命令安装软件包

dpkg -i ./ca-certificates_20210119~18.04.2_all.deb

如果没有安装VMware Tools,可以采用命令行方式下载

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates/ca-certificates_20210119~18.04.2_all.deb
dpkg -i ./ca-certificates_20210119~18.04.2_all.deb

最后使用如下代码完成认证证书的更新

apt-get update
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐