GPG key retrieval failed: [Errno 14] curl#37 – Couldn’t open file … RPM-GPG-KEY [CentOS 7]

Centos is a very solid operating system, and in our opinion it is much better on the security side than Ubuntu, especially when we have a web server.
Over the years Centos has evolved a lot, and the transition from Centos 6.x to 7.X has brought many changes to the security side.

Very many vulnerability on the old versions of Centos appeared because of the archives software installations (YUM repository) less safe. For example, a simple installation of Lemp (Linux, NGINX, MySQL & PHP) can create problems over time if these packages have not been installed from safe sources.
With the launch of Centos 7, limitations were set for user access to system files and limitations in packing installation “unsigned” or without GPG Key. If you have adjusted this article, you most likely met the error:

GPG key retrieval failed: [Errno 14] curl#37 - Couldn't open file ...  RPM-GPG-KEY

This occurs when we want to install (ym install) or update (yum -y update) to softear packages that do not contain GNU Privacy Guard (GPG).
Software and developmental producers are urged that each software included in the installation packages (RPM) are accompanied by a signature. It is a simpler method by which a guarantee for users can be offered that these RPMs are safe. The public key (Public Key) accompanying installation packages is covered inRed Hat Network Channel Management Guide and must be registered for each software in the archive.

If you meet such an error, it is best to look for an archive with the public public from which to install the desired software. If you still want to continue the installation, the simplest method is to deactivate the public key check in the installation archive.

By default, the installation archives and software update are located in “/etc/yum.repos.d”. Edit with “nano” or “vi” FILE “.repo” from which is extracted / unloaded .RPM file without public key and disable “gpgcheck“. Set value “0”.

 [epel]
 name=Extra Packages for Enterprise Linux 7 - $basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
 metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
 failovermethod=priority
 enabled=1
 exclude=nginx*
 gpgcheck=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 

Salvate the changes in the .Repo file edited and run the update / installation again. Everything should go without problems.

Passionate about technology, I write with pleasure on stealthsetts.com starting with 2006. I have a rich experience in operating systems: Macos, Windows and Linux, but also in programming languages ​​and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, Presashop).

Home Your source of IT tutorials, useful tips and news. GPG key retrieval failed: [Errno 14] curl#37 – Couldn’t open file … RPM-GPG-KEY [CentOS 7]

1 thought on “GPG key retrieval failed: [Errno 14] curl#37 – Couldn’t open file … RPM-GPG-KEY [CentOS 7]”

Leave a Comment