Import GPG key in CentOS 7

I was trying to deploy a ceph cluster on CentOS 7 machine and while following the steps mentioned on this page, I ran into following error:

You have enabled checking of packages via GPG keys. This is a good thing.
However, you do not have any GPG public keys installed. You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
rpm --import public.gpg.key
Alternatively you can specify the url to the key you would like to use
for a repository in the 'gpgkey' option in a repository section and yum
will install it for you.

For more information contact your distribution or package provider.

Problem repository: dl.fedoraproject.org_pub_epel_7_x86_64_

Solution to this problem is to run the following command. Please note that you must have root privileges to do so.

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

And voila! Everything was fine. Hope I helped.

References:

[1] https://www.centos.org/keys/#importing-keys 

2 Comments

DanStrong February 28, 2018 Reply

It is very helpful! Thanks a lot!

Leave a Reply