Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 8 down vote accepted

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

share|improve this answer

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

share|improve this answer
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. – Joshc1107 Jan 18 '12 at 14:58

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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