gpg: connecting dirmngr failed: IPC connect call failed

This article was published 3 years ago. Due to the rapidly evolving world of technology, some concepts may no longer be applicable.

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

Thoughts on this post

Leave a comment?