GPG key retrieval failed
Tried to install some packages through yum, but it failed with "GPG key retrieval failed".
GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle"
This is because yum repository cannot find a valid GPG key for Linux to verify the installation, so the solution is to download the proper GPG key for your system. In this case, we used Oracle public yum in CentOS 7 to install packages.
Please note that, what I highlighted in the above text is the target file that you have to copy to.
Oracle Linux 6
[root@primary01 yum.repos.d]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Oracle Linux 7
[root@primary01 yum.repos.d]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[root@primary01 yum.repos.d]# ll /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
-rw-r--r--. 1 root root 1011 Jul 23 2014 RPM-GPG-KEY-oracle
We have restored the missing file.
Thanks Sir ji .
You’re welcome.