I recently upgraded from Ubuntu 16.04 to 18.04, which came with a gpg upgrade from 0.5.0 to 0.6.0. Since that upgrade my GPG cannot decrypt files anymore:
mst@mst-nb1:~$ gpg --list-keys
/home/mst/.gnupg/pubring.kbx
----------------------------
pub rsa4096 2016-03-13 [SC]
6C6AE8C5E06D2AEF8FABE9C11EBC1C55E2D201A2
uid [ultimate] Mauro Stettler <mauro.stettler@gmail.com>
sub rsa4096 2016-03-13 [E]
mst@mst-nb1:~$ gpg --list-secret-keys
/home/mst/.gnupg/pubring.kbx
----------------------------
sec rsa4096 2016-03-13 [SC]
6C6AE8C5E06D2AEF8FABE9C11EBC1C55E2D201A2
uid [ultimate] Mauro Stettler <mauro.stettler@gmail.com>
ssb rsa4096 2016-03-13 [E]
mst@mst-nb1:~$ gpg -e -r 6C6AE8C5E06D2AEF8FABE9C11EBC1C55E2D201A2 abc
mst@mst-nb1:~$ gpg -d -u 6C6AE8C5E06D2AEF8FABE9C11EBC1C55E2D201A2 abc.gpg
gpg: encrypted with 4096-bit RSA key, ID 8786533A08A9D4AD, created 2016-03-13
"Mauro Stettler <mauro.stettler@gmail.com>"
gpg: public key decryption failed: End of file
gpg: decryption failed: No secret key
I have already tried wiping my ~/.gnupg folder and reimporting the keys, but that problem remains.
After a lot of trial & error I found the problem:
I've had a self-built version of libtinfo5
installed. Apparently the system update caused this library not work properly anymore because it was built for the older system. Once I removed the custom built files and reinstalled libtinfo5
from apt
everything worked fine again.