Skip to content

Instantly share code, notes, and snippets.

@gaborgsomogyi
Last active October 15, 2025 14:17
Show Gist options
  • Save gaborgsomogyi/20438561d985decc31adedc6349652b9 to your computer and use it in GitHub Desktop.
Save gaborgsomogyi/20438561d985decc31adedc6349652b9 to your computer and use it in GitHub Desktop.

Which version affected?

$ gpg --version
gpg (GnuPG) 2.4.8

What kind of issue is one facing with?

Simple hanging!

Solution

pkill -9 dirmngr

cat <<EOF > ~/.gnupg/dirmngr.conf
disable-ipv6
standard-resolver
keyserver hkps://keys.openpgp.org:443
EOF

gpg --recv-key AA69A48B2A51091D
gpg: key AA69A48B2A51091D: "Gabor Somogyi (CODE SIGNING KEY) <[email protected]>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

When hanging

There are cases when gpg is just hanging. This could happen when globbing is used with nullglob. In short when a command has glob inside (gpg --armor --detach-sig apache_flink*.tar.gz) and there is no file matching then the result is empty which makes gpg command wait on stdin.

The solution is unsetopt nullglob which will make globbing blow up when no file exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment