I keep getting a recurring problem in Fedora 41 and now 42 where the GPG database gets locked and nothing I try can get it working. I have to delete the
.gnupg
directory and re-import my keys all over again.
The problem manifests after a reboot and I discover it the next time I try and commit code to git.
I have tried:
1. Killing the process.
2. Rebooting.
3. rm -f ~/.gnupg/*.lock
4. gpgconf --kill all && gpgconf --launch gpg-agent
Additional info based on question below:
$ gpg --list-keys
gpg: Note: database_open 134217901 waiting for lock (held by 5289) ...
gpg: Note: database_open 134217901 waiting for lock (held by 5289) ...
gpg: Note: database_open 134217901 waiting for lock (held by 5289) ...
gpg: Note: database_open 134217901 waiting for lock (held by 5289) ...
gpg: Note: database_open 134217901 waiting for lock (held by 5289) ...
gpg: keydb_search_first failed: Connection timed out
$ lsof | grep 5289
$$ tree ~/.gnupg
/home/bryon/.gnupg
├── common.conf
├── private-keys-v1.d
│ ├── 3ED6F3A0FE32B7DFEC04340B9AFCDB4842DFDC85.key
│ ├── 6026F43FDF049972ED2ABFF215E85EB4937D6B45.key
│ ├── 81F8A0D8D0E9CD406AE2C89B16AA4D4E872A39AD.key
│ └── FAC9D0944809312FCD2EC1C5B3D9F79210AECF8D.key
├── public-keys.d
│ ├── pubring.db
│ └── pubring.db.lock
└── trustdb.gpg
3 directories, 8 files
$ lsof ~/.gnupg/public-keys.d/pubring.db.lock
$
Asked by Bryon
(369 rep)
Jun 16, 2025, 06:37 AM
Last activity: Jun 18, 2025, 05:15 AM
Last activity: Jun 18, 2025, 05:15 AM