Certificate verification failed: The certificate is NOT trusted.解决方案

我在linux上安装一个包的时候遇到了如下的错误:

(base) cnptucs1@cnptucs1:~$ sudo apt-get install -y libssl-dev --fix-missing
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.15.0-72 linux-headers-4.15.0-72-generic linux-image-4.15.0-72-generic
  linux-modules-4.15.0-72-generic linux-modules-extra-4.15.0-72-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libssl1.1
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  libssl-dev
The following packages will be upgraded:
  libssl1.1
1 upgraded, 1 newly installed, 0 to remove and 251 not upgraded.
Need to get 1,566 kB/2,867 kB of archives.
After this operation, 7,848 kB of additional disk space will be used.
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libssl-dev amd64 1.1.1-1ubuntu2.1~18.04.6
Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libssl-dev amd64 1.1.1-1ubuntu2.1~18.04.6
  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]
Preconfiguring packages ...
(Reading database ... 163679 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1-1ubuntu2.1~18.04.6_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.6) over (1.1.1-1ubuntu2.1~18.04.5) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.6) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.deb: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.deb: No system certificates available. Try installing ca-certificates.
E: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.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]

参考此处, 可以得出如下方法:

1. 重装ca-certificates. 

sudo apt-get install --reinstall ca-certificates

2. 运行如下命令:

sudo apt-get update

3. 重新运行安装包的命令.

 Certificate verification failed: The certificate is NOT trusted.解决方案

 

上一篇:阿里云服务器Centos7.9安装mysql57数据库和Vim


下一篇:Keepalived启动报错