gpg: connecting dirmngr failed: IPC connect call failed

When trying to run --recv-key I was running into issues where dirmngr didn’t exist. As it turns out, it’s the same issue I was having where gpg-agent couldn’t start/

Given the following error message:

$ gpg --recv-key 0xDEADBEEF
gpg: DBG: locking for '/home/michael/.gnupg/gnupg_spawn_dirmngr_sentinel.lock' done via O_EXCL
gpg: connecting dirmngr at '/home/michael/.gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr

The fix is to redirect the socket to somewhere writeable.

$ printf '%%Assuan%%\nsocket=/dev/shm/S.dirmngr\n' > ~/.gnupg/S.dirmngr

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Leave a comment?

Leave a Reply