Ubuntu系统 apt-get update失败,出现“Certificate verification failed ”错误以及“无法安全地用该源进行更新“等问题解决办法

Ubuntu系统 apt-get update失败,出现“Certificate verification failed: The certificate is NOT trusted. ”错误以及“无法安全地用该源进行更新,所以默认禁用该源”问题解决办法

问题1:Certificate verification failed

以前使用的是清华源https://mirrors.tuna.tsinghua.edu.cn/ubuntu,最近重新使用Ubuntu发现无法更新软件,出现以下错误:

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

image-20220108113414362

通过查询得知是证书失效,需要重新安装ca-certificates。

使用命令失败:

apt-get install ca-certificates --reinstall

需要手动下载 ca-certificates deb 文件重新安装最新版,下载地址:

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

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

选择自己Ubuntu对应的版本的deb文件下载。

查看Ubuntu版本命令:

lsb_release -a

image-20220108114313755

博主当前版本为20.04,所以选择该版本的deb文件:

image-20220108114445929

下载完成后,对其进行解压安装:

dpkg -i ca-certificates_20210119~20.04.2_all.deb

image-20220108114653929

安装完成后,再输入apt-get update命令,不报错。

问题二:无法安全地用该源进行更新,所以默认禁用该源

image-20220108114845810

解决办法:

首先查看源列表,输入以下命令:

vim /etc/apt/sources.list

image-20220108115208193

当前源列表里并没有ppa开头的源:

仓库 “http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu

然后再设置->关于->软件更新中发现,ppa开头的那个源被勾选了,将其取消勾选即可:

image-20220108115508865

再次输入命令:

sudo apt-get update

即可成功。此外,关于源的的更换可以参考以下文章:

https://zhuanlan.zhihu.com/p/142014944

具体做法是打开/etc/apt/sources.list文件,在其中添加如下条目:

``

#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
#添加清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse

常用指令:

更新源

sudo apt-get update

如出现依赖问题,解决方式如下:

sudo apt-get -f install

更新软件:

sudo apt-get upgrade
  • 30
    点赞
  • 110
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论
APT是Ubuntu系统中用于包管理的工具,apt-get update命令用于更新软件源列表。如果在执行apt-get update出现错误,可能是由于软件源链接失效或证书验证失败导致的。 根据引用,即使在更改并保存了软件源后,执行apt-get update仍然会报错,这是因为原来的软件源链接仍然存在且无法使用。但是系统会自动选择可用的软件源链接进行更新,比如阿里云链接,最终可以成功更新。 根据引用,当出现"Certificate verification failed"错误时,表示证书验证失败。这可能是由于软件源的证书不受信任导致的。解决这个问题的方法是手动安装软件源的证书或更新证书验证。 根据引用,提供了一个使用阿里云的Ubuntu 20.04软件源的配置示例。你可以将这些配置添加到你的软件源列表中,然后再次执行apt-get update命令。 综上所述,如果apt-get update失败,你可以尝试更换可用的软件源链接、更新证书验证或添加可信任的软件源配置。希望这些解决方案能够帮助你解决问题123 #### 引用[.reference_title] - *1* *3* [sudo apt-get update 失败 的解决](https://blog.csdn.net/LIWEI940638093/article/details/130250047)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *2* [Ubuntu系统 apt-get update失败出现Certificate verification failed错误以及“无法安全地用该源...](https://blog.csdn.net/luolaihua2018/article/details/122378383)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SOC罗三炮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值