Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keychain: Warning: can't find gpg key; skipping

I'm trying to use keychain(1) with my GnuPG key on Debian Testing. However, I get the following message with this command:

$ keychain --agents gpg MYPGPKEY

 * keychain 2.8.2 ~ http://www.funtoo.org
 * Starting gpg-agent...
 * Warning: can't find MYPGPKEY; skipping

where MYPGPKEY is my actual key.

I can check that such key exits with the following command:

$ gpg --list-keys MYPGPKEY >/dev/null 2>&1 && echo "key exists"
key exists

How can I add my gpg key with keychain?

like image 508
Petr Razumov Avatar asked Sep 15 '25 04:09

Petr Razumov


2 Answers

It looks like an output parsing incompatibility between keychain 2.8.2 and gpg 2.2.4, the two versions used in Ubuntu 18.04

I added the following to my ~/.gnupg/gpg.conf, which fixed the issue:

keyid-format LONG

Source: https://github.com/funtoo/keychain/issues/107

like image 146
Prashanth Chandra Avatar answered Sep 17 '25 18:09

Prashanth Chandra


I believe the problem may be associated with your gpg and keychain version possible incompatibility. I can see that you are using 2.8.2 version which displays this error message that 2.7.0 doesn't. Stable version of Debian is using gnupg 1.4.18-7+deb8u3enter code here and Testing is using 2.1.18-6, which differ a lot. Are you using your private key ID or your subkey ID? My suggestion is changing the key ID provided to keychain

Reference

like image 30
Kudlaty 01 Avatar answered Sep 17 '25 20:09

Kudlaty 01