28

I'm using Centos 6.5 and when I want to install packages from yum I get this error:

GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias

How can I fix this?

1
  • I had the same problem and I just set the whole server back to an earlier check point (using Hyper - V) and then it worked. Commented Apr 7, 2020 at 21:37

7 Answers 7

25

If you trust the repo, you can simply edit the file /etc/yum.repos.d/mysql-community.repo and disable the gpgcheck

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=0
0
19

This error happens because you have some YUM repository configuration in /etc/yum.repos.d/ that lists a GPG key like this:

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias

This configuration is telling YUM that the GPG key for the repository exists on disk. The error you get from YUM is YUM letting you know that it couldn't find the GPG key at the path /etc/pki/rpm-gpg/RPM-GPG-KEY-puias

So, by manually writing the GPG key to /etc/pki/rpm-gpg/RPM-GPG-KEY-puias like you did, YUM was then able to find the key at that path.

Alternatively, you could have set gpgkey to the URL of the key, like this:

gpgkey=http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias

in you repository configuration.

GPG and YUM/RPM can be quite tricky. If you are curious about how more of the internals work, check out this blog post.

18

You can also disable gpg check without editing repo file with this command :
yum install --nogpgcheck your_package

1
  • BEST SOLUTION EVER
    – skywind
    Commented Jan 10, 2023 at 22:38
2

This worked for me: Go to /etc/pki/rpm-gpg directory and download the RPM-GPG-KEY-puias from http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias :

su - root
cd /etc/pki/rpm-gpg
wget http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias

By the way, I appreciate if someone explains the issue more.

2

When using yum install, I occasionally encounter such an error: Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

This is because the following GPG key is listed in the configuration file for your yum repository in your /etc/yum.repos.d directory:

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 This configuration tells YUM that the GPG key for this repository exists on disk. When YUM can't find the GPG key in the path /etc/pki/rpm-gpg, it will report the above error.

solution:

 cd /etc/pki/rpm-gpg


 wget https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

ref: https://www.programmersought.com/article/94451561249/

0

This issue occurs when you try to install Docker on CentOS using the standard installation guide available on the Official Website

In the Step 3 change the baseurl and gpgkey URL from https to http and it works, example below

$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=**http**://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=**http**://yum.dockerproject.org/gpg
EOF
0

For me, the solution that worked are:

sudo vim URPMS-GPG-PUBLICKEY-Fedora-24

I am not sure what of the two files are the correct name. I make the two for instance.

In the content copy paste the content of:
https://github.com/UnitedRPMs/unitedrpms.github.io/blob/master/URPMS-GPG-PUBLICKEY-Fedora-24

and that works fine!

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .