解决Certificate verification failed错误

问题表现

执行sudo apt update的时候,所有更新项目都报以下错误:

Certificate verification failed: The certificate is NOT trusted. The certificate chain uses not yet valid certificate.  Could not handshake: Error in the certificate verification

问题原因

猜测可能是因为改了时区,导致证书失效。

解决方案

调整更新源URL协议,需要在/etc/apt/sources.list文件中找到更新源,把其中的链接开头的https协议改成http,然后安装ntp,实现网络时间同步,避免因为时间问题导致证书出错:
执行

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /etc/apt/sources.list

将/etc/apt/sources.list中所有https改为http
然后执行:

# 更新源
sudo apt-get update
# 安装ntp,以实现网络时间同步
sudo apt-get install ntp
sudo systemctl start ntp
sudo systemctl enable ntp

最后再试一下

sudo apt-get update

正常情况下不会再报错了。
调整过的source.list可以再改回https协议,也可以不改回去。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值