server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

docker换源以后,就报了这个错。

换源前:

deb http://deb.debian.org/debian stretch main contrib non-free

换源后:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

解决方法:把软件源里的https改成http

vi /etc/apt/sources.list

apt-get update

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

报错1:

W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93D
W: The repository 'http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease' is not signed. 
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. 
N: See apt-secure(8) manpage for repository creation and user configuration details. 
root@syzkaller:~# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 871920D1991BC93D

解决1:

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 871920D1991BC93C(上面显示的公钥)

报错2:

failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory

解决2:

sudo apt-get update -y

sudo apt-get install -y dirmngr

折腾2小时终于搞定了。

扩展:

1.LINUX发行版-之路教程

相关文章

学习编程是顺着互联网的发展潮流,是一件好事。新手如何学习...
IT行业是什么工作做什么?IT行业的工作有:产品策划类、页面...
女生学Java好就业吗?女生适合学Java编程吗?目前有不少女生...
Can’t connect to local MySQL server through socket \'/v...
oracle基本命令 一、登录操作 1.管理员登录 # 管理员登录 ...
一、背景 因为项目中需要通北京网络,所以需要连vpn,但是服...