gpg:密钥服务器接收失败:没有dirmngr


94

尝试在Debian Stretch服务器中接收密钥时,出现以下错误:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Executing: /tmp/apt-key-gpghome.4B7hWtn7Rm/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.4B7hWtn7Rm/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

Answers:


136

安装软件包dirmngr可修复该错误。

user@debian-server:~$ sudo apt-get install dirmngr

重试:

user@debian-server:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Executing: /tmp/apt-key-gpghome.haKuPppywi/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: key A6A19B38D3D831EF: public key "Xamarin Public Jenkins (auto-signing) <releng@xamarin.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

3
在Debian 9.4上也有同样的问题。安装dirmngr可以修复它。
AAAfarmclub

我收到了与OP相同的错误,但是我已经安装了最新的gpg。
realtebo

1
安装已gpg在Debian 9.3上为我修复。 dirmngr已安装。
Liviu Chircu '18

Raspbian 9.8拉伸上的相同问题。安装dirmngr解决了该问题。谢谢。
user8675309

9

我无法使dirmngr正常工作,但是您也可以直接使用apt-key add导入密钥。GPG公钥通常在回购协议的根目录中列出,例如http://origin-download.mono-project.com/repo/

curl https://origin-download.mono-project.com/repo/xamarin.gpg | sudo apt-key add -

2
如果尚未运行,则需要运行dirmngr。
请删除我

dirmngr正在运行,但仍然没有喜悦...如果密钥服务器恰好是keyserver.ubuntu.com,那么您可以通过浏览器访问并使用--recv-keys参数搜索公钥,然后apt-key add按照此答案简单使用
Earcam
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.