pgp


Installing Jenkins on Red Hat (CentOS 7 64bit) distributions

Following the official guides:

We tried to install Jenkins using the RPM repositories.

sudo yum install java -y;
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo;
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key;
sudo yum install jenkins -y;

Unfortunately, that resulted in an error:

warning: /var/cache/yum/x86_64/7/jenkins/packages/jenkins-2.19.2-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY

Public key for jenkins-2.19.2-1.1.noarch.rpm is not installed

Apparently, sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key; failed silently and it did not import the key.

To verify, we executed rpm -qa gpg-pubkey* to display a list of all keys installed for RPM verification. From that list we wanted to see if any of the keys was the one needed by jenkins which should end with the value d50582e6. Since none of them matched, we tried to manually re-import it which failed again.

Our Solution

Our solution, although ugly, was to disable  PGP verification in the file /etc/yum.repos.d/jenkins.repo.

[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=0

That was enough to allow us to install the package using:

sudo yum install jenkins -y;

Finally, we started jenkins using sudo service jenkins start;.

Logs from failed installation


[bytefreaks@localhost ~]$ sudo yum install jenkins -y
[sudo] password for bytefreaks:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.coreix.net
* extras: mirrors.coreix.net
* updates: mirrors.coreix.net
Resolving Dependencies
--> Running transaction check
---> Package jenkins.noarch 0:2.19.2-1.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================================================================
Package                                                Arch                                                  Version                                                     Repository                                              Size
=======================================================================================================================================================================================================================================
Installing:
jenkins                                                noarch                                                2.19.2-1.1                                                  jenkins                                                 66 M

Transaction Summary
=======================================================================================================================================================================================================================================
Install  1 Package

Total size: 66 M
Installed size: 67 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/jenkins/packages/jenkins-2.19.2-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY


Public key for jenkins-2.19.2-1.1.noarch.rpm is not installed