关于Ubuntu(Debian)软件源报错问题及解决

问题:在执行sudo apt-get update时出现以下报错,查询得知是因为换源以后,新的下载源没有公钥

W: GPG error: http://mirrors.aliyun.com/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY DCC9EFBF77E11517
W: The repository 'http://mirrors.aliyun.com/debian buster 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.

查了网上的帖子得知运行以下命令即可

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys  648ACFD622F3D138 0E98404D386FA1D9 #此处的两个密钥,根据上面的提示输入

执行上述命令我报了另一个错如下:

gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/run/user/0/gnupg/d.69bou1oox7kpsyamgp6b3ba7/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

说明缺少软件,那就安装依赖,在执行添加公钥的命令

sudo apt-get install software-properties-common dirmngr
linaro@bm1682:/data/ZhouShanV4_se3_so_828$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys  648ACFD622F3D138 0E98404D386FA1D9  DCC9EFBF77E11517 112695A0E562B32A 54404762BBB6E853 

若出现以下,代码即为成功
Executing: /tmp/apt-key-gpghome.4xwojFTNfF/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9 DCC9EFBF77E11517 112695A0E562B32A 54404762BBB6E853
gpg: key A48449044AAD5C5D: public key “Debian Security Archive Automatic Signing Key (11/bullseye) ftpmaster@debian.org” imported
gpg: key 4DFAB270CAA96DFA: public key “Debian Security Archive Automatic Signing Key (10/buster) ftpmaster@debian.org” imported
gpg: key DCC9EFBF77E11517: public key “Debian Stable Release Key (10/buster) debian-release@lists.debian.org” imported
gpg: key 73A4F27B8DD47936: public key “Debian Archive Automatic Signing Key (11/bullseye) ftpmaster@debian.org” imported
gpg: key DC30D7C23CBBABEE: public key “Debian Archive Automatic Signing Key (10/buster) ftpmaster@debian.org” imported
gpg: Total number processed: 5
gpg: imported: 5

再执行 sudo apt-get update 就可以了

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值