Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect GnuPG command listed in installation instructions? #22

Open
Vandino86 opened this issue Jun 9, 2024 · 0 comments
Open

Incorrect GnuPG command listed in installation instructions? #22

Vandino86 opened this issue Jun 9, 2024 · 0 comments

Comments

@Vandino86
Copy link

Vandino86 commented Jun 9, 2024

I'm running Linux Mint 21.3 Cinnamon. When running the GnuPG command listed in the installation instructions blog post (sudo -E gpg --no-default-keyring --keyring=/usr/share/keyrings/javinator9889-ppa-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 08633B4AAAEB49FC), it gave me the following errors:

gpg: keybox '/usr/share/keyrings/javinator9889-ppa-keyring.gpg' created
gpg: failed to create temporary file '/home/user1/.gnupg/.#lk0x000063f6fc6d7970.user1-HP-ENVY-15-x360-PC.5100': No such file or directory
gpg: connecting dirmngr at '/home/user1/.gnupg/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

After adding the stable repo (sudo tee /etc/apt/sources.list.d/javinator9889-ppa.list <<< "deb [arch=amd64 signed-by=/usr/share/keyrings/javinator9889-ppa-keyring.gpg] https://ppa.javinator9889.com all main"), sudo apt update gave me the following errors:

...
Err:14 https://ppa.javinator9889.com all InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2A43BD5139A4173
...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://ppa.javinator9889.com all InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2A43BD5139A4173
W: Failed to fetch https://ppa.javinator9889.com/dists/all/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2A43BD5139A4173
W: Some index files failed to download. They have been ignored, or old ones used instead.

I should note that I didn't have a .gnupg already existing in my user home dir (/home/user1/) before running these commands. After doing some research, GnuPG (at least when run as non-sudo) is supposed to create the .gnupg dir there if it doesn't exist, but it doesn't do so with this command for some reason. After some more research and experimenting, mainly this Stack Overflow answer, I found two different solutions that worked for me:

  1. Run the GnuPG command as sudo, but with -H instead of -E (sudo -H gpg --no-default-keyring --keyring=/usr/share/keyrings/javinator9889-ppa-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 08633B4AAAEB49FC) (this used my .gnupg dir in /root/ instead, which I apparently already had, but I recently tested this out after deleting /root/.gnupg/ and it failed to create the directory as well) OR
  2. Running gpg --no-default-keyring --keyring=javinator9889-ppa-keyring.gpg --keyserver keyserver.ubuntu.com --recv-keys 08633B4AAAEB49FC && sudo mv -f .gnupg/javinator9889-ppa-keyring.gpg /usr/share/keyrings/

I prefer the second one since it actually does create the .gnupg dir in home/user1/ if it doesn't already exist there, unlike the other 2 gpg commands here. Running gpg as non-sudo without options if a .gnupg dir doesn't already exist in /home/user1/ will also create that dir. However, running the original sudo -E gpg ... command after that will result in a warning saying gpg: WARNING: unsafe ownership on homedir '/home/user1/.gnupg'. Researching this warning led me to the aforementioned Stack Overflow page.

I understand sudo is necessary to move javinator9889-ppa-keyring.gpg to /usr/share/keyrings/, but I'm not sure if gpg specifically needs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant