Remove the lock file to resolve GPG lock issue
gpg: waiting for lock (held by [process_id]) indicates a previous GPG process did not terminate normally and left a stale lock file.
Use the following to locate the lock file.
ls -l ~/.gnupg/*.lock
ls -l ~/.gnupg/**/*.lock
Remove the lock file.
rm ~/.gnupg/[name-of-the-stale-lock-file].lock
Restart the GPG agent if needed.
gpgconf --reload gpg-agent
Test GPG operation.
echo "test" | gpg --clearsign
If you don’t see the same waiting for lock message, the issue is fixed.