I believe I've read and tried all the suggestions, starting with this post about the exact same issue.
I'm trying to generate a new key with:
gpg --full-generate-key
and it keeps ending with:
gpg: agent_genkey failed: No such file or directory
Key generation failed: No such file or directory
Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-88-generic x86_64), headless
gpg --version
gpg (GnuPG) 2.2.4
libgcrypt 1.8.1
Home: /home/mark/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
I've killed gpg-agent and restarted the server multiple times.
gpgconf --kill gpg-agent
ps aux | grep gpg-agent
mark 1637 0.0 0.0 14428 1052 pts/0 S+ 13:55 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn gpg-agent
The .gnupg directory permissions:
drwx------ 3 mark mark 4.0K Mar 6 14:01 .gnupg
I've deleted ~/.gnupg multiple times, rebooting each time for good measure:
ls -la ~/.gnupg
total 12K
drwx------ 3 mark mark 4.0K Mar 6 14:00 .
drwxr-xr-x 17 mark mark 4.0K Mar 6 14:01 ..
drwx------ 2 mark mark 4.0K Mar 6 14:00 private-keys-v1.d
I've repeated the following several times with the same result:
ls -la ~/.gnupg
total 16K
drwx------ 3 mark mark 4.0K Mar 6 14:01 .
drwxr-xr-x 17 mark mark 4.0K Mar 6 14:04 ..
drwx------ 2 mark mark 4.0K Mar 6 14:00 private-keys-v1.d
-rw------- 1 mark mark 32 Mar 6 14:01 pubring.kbx
I changed pubring.kbx
to 700 and ran again, same result (grasping at straws)
ps aux | grep gpg-agent
mark 1751 0.0 0.0 93316 3348 ? SLs 14:02 0:00 /usr/bin/gpg-agent --supervised
mark 1758 0.0 0.0 14428 1084 pts/0 S+ 14:06 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn gpg-agent
I also ran with strace
but not sure how to decipher that output. Last line is +++ exited with 2 +++
strace -o /tmp/foo gpg --full-generate-key
I'm at a loss here.