Fixing “Public key for mod_cloudflare-*.rpm is not installed” Error 2

I went to update the mod_cloudflare package on a CentOS / RHEL box this morning, and ran unto the following problem:

% sudo yum update -y mod_cloudflare
Resolving Dependencies
--> Running transaction check
---> Package mod_cloudflare.x86_64 0:1.2.0-1360806316.el6 will be updated
---> Package mod_cloudflare.x86_64 0:1.3.1-1.el6 will be an update
--> Finished Dependency Resolution


Downloading Packages:
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 8caccbf8: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CLOUDFLARE-MOD_CLOUDFLARE-1
Importing GPG key 0x8E5F9A5D:
 Userid: "CloudFlare Software Packaging <[email protected]>"
Is this ok [y/N]: y

Public key for mod_cloudflare-1.3.1-1.el6.x86_64.rpm is not installed

Even when pressing “y” to import the key, I couldn’t install mod_cloudflare with yum.

CloudFlare explains that they updated their GPG public packaging key earlier this year, so anyone using the older key with an ID of 8e5f9a5d will need to install the new key and delete the old one.

Install the new CloudFlare GPG key with:

% sudo rpm --import

Then delete the outdated CloudFlare GPG key with:

% sudo rpm -e gpg-pubkey-8e5f9a5d-*

Now you should be able to use yum to update mod_cloudflare without any problem!