I’m trying to update the git version on a Debian 10 (buster) machine and running into issues with gpg key.
> sudo add-apt-repository ppa:git-core/ppa
The most current stable version of Git for Ubuntu.
For release candidates, go to https://launchpad.net/~git-core/+archive/candidate .
More info: https://launchpad.net/~git-core/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpfqaimru3/pubring.gpg' created
gpg: /tmp/tmpfqaimru3/trustdb.gpg: trustdb created
gpg: key A1715D88E1DF1F24: public key "Launchpad PPA for Ubuntu Git Maintainers" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
I also tried to manually add key, but still end up with same error after adding the key successfully.
> sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1715D88E1DF1F24
Executing: /tmp/apt-key-gpghome.pwYjc1J0zy/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys A1715D88E1DF1F24
gpg: key A1715D88E1DF1F24: public key "Launchpad PPA for Ubuntu Git Maintainers" imported
gpg: Total number processed: 1
gpg: imported: 1
And also:
> gpg --export A1715D88E1DF1F24 | sudo apt-key add -
gpg: WARNING: nothing exported
gpg: no valid OpenPGP data found.
Not sure what I’m doing wrong. I’ve also done update a few times.
> sudo apt-get update
2
Answers
As in this issue, check if you see expired keys with
sudo apt-key list
Depending on what you see in
/etc/apt/sources.list.d/
, you could infer the URL of the ‘gpgkey
‘ to import.I tried this in a docker container and
doesn’t work there as well. But
works.
note that the only difference to your command is, that i am invoking the
gpg --export
command with sudo.The explanation for this behaviour is, that
imports the key into the keyring of root. So if you invoke the command without sudo gpg cant find the key you’ve imported.