Public key for *.rpm is not installed : How to resolve ??


While install RPM using YUM repo i got a key error. If you got this kind of key error you can resolve this issue using below 2 ways.

 Error : Public key for *.rpm is not installed

(Ex - Public key for tix-8.4.0-11.fc6.i386.rpm is not installed )

Reason :This is because of private key verification for redhat RPMs got failed. While we install RPMs using yum default it will check and verify the private key.


we can use this below ways to resolve the issue.

1. Disable the rpm signature check in YUM repo config

2. Import the public keys on server


Way 1: How to Disable the signature check for RPMs?

Go to repo directory and edit the repo config file.

#vi /etc/yum.repos.d/myrpm.repo

[rhel-myrpms]
name=Red Hat Enterprise Linux $releasever - RPMs
baseurl=file:///var/ftp/pub/serverrpm
enabled=1
gpgcheck=0 -------------------------//Modify this value as '0'
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release  //you can give this key path if the above gpcheck value is '1'


save and exit.

Now you can install any rpm using yum and it wont check the key signature. If this gpcheck is enabled then you need to mention the key path like above file.


Way 2 : How to import the key public key files for RPM ?


# find / -name *GPG*    //find the publick key file & locations


Then import the public keys using below commands.

for me i got below locations , so i installed like below

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-auxiliary

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-former

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-rhx

Then now you can install any rpm . And now you wont get any key error, the keys will be verified using the imported key.


Post a Comment

21 Comments

  1. This post is Godsend. Solved my problem amidst all other google results.

    I did not try Way1 as "myrpm.repo" not exist. Way2 solved problem for me.

    I use CentOS 6.0 64bit.

    ReplyDelete
  2. But when I import -rpm etc/... I get permission denied. what should I do. I'm running everything in su mode.

    ReplyDelete