解决Ubuntu下换清华源报错:由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32

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

通过sudo vim /etc/apt/sources.list 输入上述代码更换清华的镜像源,但在sudo apt-get update后出现以下报错

获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease [242 kB]
命中:2 https://packages.microsoft.com/repos/code stable InRelease              
获取:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [102 kB]
错误:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease            
  由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
错误:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease    
  由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
获取:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [102 kB]
获取:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [102 kB]
错误:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
  由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
错误:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
  由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
命中:6 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
正在读取软件包列表... 完成
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

 通过指令 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 3B4FE6ACC0B21F32   将76F1A20FF987672F替换为你报错中 NO_PUBKEY 后的ID 3B4FE6ACC0B21F32 输入运行sudo apt-get update即可正常

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值