我在尝试使用GPG解密某些密钥时遇到问题.以下输出给了我:
gpg: can't connect to the agent: IPC connect call failed
Run Code Online (Sandbox Code Playgroud)
我已经编辑了一些文件,在本教程中指出:https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/但没有成功.
可能的原因是什么?
提前致谢
pre*_*ngh 190
即使我在 Ubuntu 20 WSL 中遇到上述问题,我也尝试了以下所有方法 | 以上建议,但没有一个对我有用。
root@7400-9888K13:/mnt/c/Users/PKammari# wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
Run Code Online (Sandbox Code Playgroud)
我做了什么来解决这个问题?
我该怎么做?
apt remove gpg (按照说明)
apt install gnupg1(按照说明)
选项 2。
sudo apt update --y
`sudo apt remove gpg`
`sudo apt-get update -y`
`sudo apt-get install -y gnupg1`
Run Code Online (Sandbox Code Playgroud)
小智 40
就我而言,代理甚至没有启动。这就是我为解决问题所做的:
C:\Program Files (x86)\gnupg\bin>gpg-connect-agent -v
gpg-connect-agent: no running gpg-agent - starting 'C:\Program Files (x86)\gnupg\bin\gpg-agent.exe'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: connection to agent established
> ^Z
Run Code Online (Sandbox Code Playgroud)
之后,对代理的命令开始工作。
Isd*_*ava 15
希望为那些对此非常陌生的人添加上面preetam的出色答案。
安装 gnupg1 - 如果您收到错误“软件包 gnupg1 不可用,但已引用.....”
sudo apt remove gpg
sudo apt-get update -y
sudo apt-get install -y gnupg1
Run Code Online (Sandbox Code Playgroud)
小智 12
系统上可能已经运行了gpg-agent,你的gpg命令无法连接到它.
如果您执行pkill -9 gpg-agent然后使用<(gpg-agent -daemon)来重新启动代理,则应该能够连接到pinentry-curses以输入密码.
Viv*_*Dev 10
我的是 Windows 机器,当我执行 git commit 时,我收到以下消息。我已经在我的机器上配置了 gpg 密钥。
gpg: can't connect to the gpg-agent: IPC connect call failed
gpg: keydb_search failed: No agent running
gpg: skipped "BBB42EB62E25E8EB33AE2E65F40A504840B1C66B": No agent running
gpg: signing failed: No agent running
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)
威尔·巴芬顿的回答对我有用。
我必须应用命令
gpg-connect-agent -v
Run Code Online (Sandbox Code Playgroud)
如下图所示反复进行。第三次尝试就成功了。
一旦我收到已建立与代理的连接的消息,我现在再次运行提交命令。现在它成功了。请注意-S标志来签署我的提交。
今天早上,尝试了 3 次后仍无法启动。我必须从安装位置双击该exe。
对我来说,以前的响应有效,但部分原因是,在我的案例中,神奇之处在于所有这些的结合,请参阅下面的命令。
如果出现错误add-apt-repository: command not found,则安装包软件属性 common。
sudo apt remove gpg
sudo apt-get update -y
sudo apt-get install -y gnupg1
# In case of Error when adding "ppa" with message: add-apt-repository: command not found
sudo apt-get install software-properties-common
# Now, the hack
sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
sudo apt update
wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6 #to avoid further update
# Edit: /var/lib/dpkg/info/libc6:amd64.postinst and remove the sleep 1 that is in nearly the last line.
Run Code Online (Sandbox Code Playgroud)
apt-get install -y gnupg gnupg1
cp -a /usr/bin/gpg /usr/bin/gpg2
ln -sf /usr/bin/gpg1 /usr/bin/gpg
Run Code Online (Sandbox Code Playgroud)
执行这些命令后,apt-key 对我有用。
我是 WSL 2.0 和 Ubuntu 20.04(Windows 10 Build 2004)。
原因:
卸载 gnupg (2.x) 也会卸载 gpg-agent,这是必需的。
安装 gnupg1 (1.x) 将只安装 gpg 二进制文件,而不是 gpg-agent。
两者都需要工作,但我们希望 gnupg1 (1.x) 成为默认的“gpg”命令(尽管使用 2.x 支持工具)。