8

I'm installing a piece of software for which I had to use a third-party repository. After adding the repository with rpm -Uvh http://[site], I installed with yum install [package]. One of the prompts that came up during installation read:

Importing GPG key 0xABCABCAB "Fname Lname <email@somewhere.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-somewhere-fname
Is this ok [y/N]: y

Does anyone know where this key is stored? I'm finished with that particular repo and don't want the additional repo/key lingering unnecessarily on my machine. I've already tried gpg --list-keys as both a regular user and root, but the key isn't listed there.

As a work around would simply removing the repo also remove the key associated with it?

3 Answers 3

9

It's stored in the rpmdb, with the name of gpg-pubkey and the version as the first 8 hexadecimal characters of the fingerprint.

9

From rpmkey manual page:


An imported public key is carried in a header, and key ring management is performed exactly like package management. For example, all currently imported public keys can be displayed by:

rpm -qa gpg-pubkey*

Details about a specific public key, when imported, can be displayed by querying. Here's information about the Red Hat GPG/DSA key:

rpm -qi gpg-pubkey-db42a60e

Finally, public keys can be erased after importing just like packages. Here's how to remove the Red Hat GPG/DSA key

rpm -e gpg-pubkey-db42a60e

1
  • thanks for the additional info, I ended up using "rpm -qa gpg-pubkey* | xargs rpm -qi" to see complete info on all the keys (a little sloppy, but it got the job done), then removed the one I didn't want installed.
    – josh-cain
    Jan 18, 2012 at 14:58
2

While Ignacio is correct, it isn't guaranteed ... and may well change in the future. Your best bet is to install the "yum-plugin-keys" package, and use the "yum keys" etc. commands.

Also note that RHEL-6.2+ yum has per. CA keys, so that is already different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.