ubuntu终端中执行命名出现错误,提示没有公钥的解决办法

 

在安装systemback时提示错误:

由于没有公钥,无法验证下列签名: NO_PUBKEY 14E4942973C62A1B

 

 

解决办法:

打开终端,去下载公钥:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 14E4942973C62A1B
后面的14E4942973C62A1B 替换成自己提示缺失的公钥。

 

 再继续执行即可。

 

 

----------------------2020.04.22更新----------------------------

今天重装了系统,在添加这个公钥的时候添加不上去了,出现报错:

whlg@whlg:~$ sudo gpg --keyserver keyserver.ubuntu.com --recv 14E4942973C62A1B
gpg: WARNING: unsafe ownership on homedir '/home/whlg/.gnupg'
gpg: keybox '/home/whlg/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: Invalid argument

在网上找了很久,突然看到有人回复说:

Why one box connected to the same network fails to resolve keyserver.ubuntu.com from dirmngr and the newer one succeeds? Why in the older box I could resolve keyserver.ubuntu.com with nslookup but dirmngr couldn't? I don't know. But the difference between the two boxes was in /etc/resolv.conf. I had added google DNS servers. Removing them from resolv.conf made dirmngr work.

nameserver 127.0.0.53
#nameserver 8.8.8.8
#nameserver 8.8.4.4 

After this change, apt-key works. Hope this helps.

忽然想到装好系统之后,我改了这个/etc/resolv.conf配置文件,添加了阿里源的服务器。

打开这个配置文件,注释掉添加的部分。

再执行

sudo gpg --keyserver keyserver.ubuntu.com --recv 14E4942973C62A1B

没有报错了。

 

相关问题连接:

https://linuxer.eu/apt-key-gpg-keyserver-receive-failed/

https://stackoverflow.com/questions/51983144/error-installing-sbt-on-ubuntu-18-04-gpg-keyserver-receive-failed-invalid-ar

posted @ 2020-02-21 21:37  寄生的鱼  阅读(1587)  评论(0编辑  收藏  举报