当我添加 gns 存储库并尝试使用此命令时出现此错误:
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B
Run Code Online (Sandbox Code Playgroud)
错误是:
gpg: keyserver receive failed: Server indicated a failure
Run Code Online (Sandbox Code Playgroud)
GAD*_*D3R 63
在防火墙后面,您应该使用端口 80 而不是默认端口 11371 :
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9A2FD067A2E3EF7B
Run Code Online (Sandbox Code Playgroud)
示例输出:
Executing: /tmp/apt-key-gpghome.mTGQWBR2AG/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 9A2FD067A2E3EF7B
gpg: key 9A2FD067A2E3EF7B: "Launchpad PPA for GNS3" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
Run Code Online (Sandbox Code Playgroud)
Yet*_*ser 14
这个问题可能是由空的 引起的(正如我刚刚经历的那样) ,就像在通过 进行主要 DNS 解析的resolv.conf
系统上的情况一样。systemd-resolved
nsswitch
gpg
我认为这是不使用相关 libc 函数的情况nsswitch
,而是出于某种原因读取resolv.conf
自身。
gpg: keyserver receive failed: Server indicated a failure
/etc/resolv.conf
为空,但主机名解析例如getent hosts google.com
等都ping google.com
可以。注意dig
, 、drill
、nslookup
都是resolv.conf
直接读取的,所以这些可能不起作用。
/etc/nsswitch.conf
hosts: files mymachines myhostname resolve [!UNAVAIL=return] dns
其中有类似的内容,其中resolve
是 systemd 提供的模块(man 8 libnss_resolve.so.2
详细信息请参阅)。
您想要创建一个指向 systemd 自动生成的符号链接resolv.conf
,以反映当前解析器设置。我建议阅读man 8 systemd-resolved
“/ETC/RESOLV.CONF”部分,了解其具体作用的详细信息。以下是我推荐的用于创建符号链接的命令和输出:
$ # you should check this has reasonable contents before using it
$ cat /run/systemd/resolve/stub-resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
$ rm /etc/resolv.conf
$ ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Run Code Online (Sandbox Code Playgroud)
这个问题对我来说真的很重要,在我在 reddit 上找到这篇文章之前,没有提出的解决方案对我有用。
我刚刚去添加了这一行/etc/resolv.conf
名称服务器 8.8.8.8 # Google dns
您可以尝试任何其他 dns,看看哪个适合您。
它与 DNS 以及您的 DNS 服务器为 dirmngr 执行或返回的内容有关;(它从 2.1.16 开始使用 dirmngr 引入,我一直在使用 Debian 的默认软件包在 2.1.6 上寻找解决方案。;(
在正确的答案是:升级到版本2.2.x以上或更高版本修正了这个问题第一次。
小智 6
在 ubuntu 18.04 上遇到同样的问题,运行 dirmngr 2.2.4。我选择检查我的 dns 设置,并添加了我的本地 dns 服务器“nameserver 1.1.1.1”和 google 的“nameserver 8.8.8.8”。然后就成功了。
归档时间: |
|
查看次数: |
63524 次 |
最近记录: |