GPG key retrieval failure

As you know, I’m not the only root in my place. Somebody else is messing with packages and similar. From time to time (specially on new systems) I get annoying yum errors. For example, like this time, when I try to install epel-release.

root@term05 ~ ## > yum install epel-release
... bla bla bla... 
warning: /var/cache/yum/x86_64/7/
epel/packages/epel-release-7-8.noarch.rpm: 
Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for epel-release-7-8.noarch.rpm is not installed
epel-release-7-8.noarch.rpm                                                  |  14 kB  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
GPG key retrieval failed: [Errno 14] 
curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7"

A simple “ls” reveals that the GPG key is gone:

root@term05 ~ ## > ls /etc/pki/rpm-gpg/
RPM-GPG-KEY-CentOS-7  RPM-GPG-KEY-CentOS-Debug-7  
RPM-GPG-KEY-CentOS-Testing-7

So we need to get the missing key from somewhere. In my case, the solution is easy: I know that there is another system with yum working fine. I simply rsync the folder from the remote machine:

root@term05 ~ ## > rsync -av root@term03:/etc/pki/rpm-gpg/ 
/etc/pki/rpm-gpg/ --delete-after --progress
...bla bla bla...
RPM-GPG-KEY-EPEL-7
        1662 100%    1.59MB/s    0:00:00 (xfer#1, to-check=1/6)
RPM-GPG-KEY-elrepo.org
        1722 100%    1.64MB/s    0:00:00 (xfer#2, to-check=0/6)
sent 52 bytes  received 3601 bytes  1461.20 bytes/sec
total size is 7768  speedup is 2.13

If I try now to install epel-release…

root@term05 ~ ## > yum install epel-release
Downloading packages:
warning: /var/cache/yum/x86_64/7/
epel/packages/epel-release-7-8.noarch.rpm: 
Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
...bla bla bla..
Complete!

So it worked! I’m not sure about what to do if I don’t have a “healthy” machine. Also, I’m not sure what produces this error. I’ll keep you posted about these issues.

Advertisements

About bitsanddragons

A traveller, an IT professional and a casual writer
This entry was posted in bits, centos, linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s