Rpm, Yum, Dnf “NOKEY” Public Key Check Error and Solution – POFTUT

Rpm, Yum, Dnf “NOKEY” Public Key Check Error and Solution

Rpm is very popular and secure package management format and application. Recent version of the rpm and yum command uses Public Key Check in order to make installation more secure. This is done by checking integrity of the rpm package.

NOKEY Error For RPM Package

We may see the error during a package installation with rpm or yum command.The main reason for this error is digital signature key not verified. Also the error has NOKEY message which can be seen below. There are different reasons for this NOKEY error for RPM packages. Solutions are explained below for these different error cases.


Show Package Signature

If we want to get more details about the signature of the package we can use -q -i options for rpm command. In this example, we will check the signature and public key of the oracle package.

$ sudo rpm -qi oracle-database-xe-18c-1.0-1.x86_64.rpm
Show Signature
Show Signature

We can see that there is a warning which will print the public key error. We can see that Signature line show information about the hash algorithm, date and time and Key ID.

Disable GPG Signature Check For The RPM Package

We will use  --nosignature in order to prevent GPG or signature check of given rpm package.

$ sudo rpm --nosignature oracle-database-xe-18c.rpm

Disable GPG Signature Check For Yum/Dnf

We can use yum or dnf command by providing --nogpgcheck option to the command. This will disable Public key or signature check for the current command. But signature check will not disabled in general.

$ yum install --nogpgcheck oracle-database.rpm

Disable GPG Signature Check For Yum/Dnf Globally

Yum is a very useful package manager which can resolve dependencies of the rpm packages and download from the network. We can set gpgcheck configuration in /etc/yum.conf . This will disable signature check for all yum or dnf commands.


LEARN MORE  How To Install and Upgrade RPM Packages In CentOS, RHEL, Fedora, Mandriva

Leave a Comment