Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The cryptographic signature of an RPM can be verified with the rpm -K command. This returns a string containing gpg (or pgp) and ending in OK if the signature is in RPM's database and is valid.

If the package is not signed but the checksums are valid, you'll still get OK, but no gpg.

If the package is signed but the key is missing from the RPM database, you get (GPG) (capital letters) and NOT OKAY, followed by (MISSING KEYS: GPG#deadbeef).

That's handy if I want to figure out what key I should find to install to make my package installation work.

But what if I want to verify which of several keys in my RPM keyring was used to sign a given package?

share|improve this question

3 Answers 3

up vote 2 down vote accepted
rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE} %{SIGPGP:pgpsig} %{SIGGPG:pgpsig}\n'
share|improve this answer
    
Only works if you have already installed the package, Brightlancer's solution below allows you to check a signature before installing –  Thomas Mar 25 at 15:47

There is a Signature field listed via rpm -qpi package.rpm, e.g.,:

[vagrant@vm-one ~]$ rpm -qpi puppet-3.7.4-1.el6.noarch.rpm
Name        : puppet
Version     : 3.7.4
Release     : 1.el6
Architecture: noarch
Install Date: (not installed)
Group       : System Environment/Base
Size        : 6532300
License     : ASL 2.0
Signature   : RSA/SHA512, Tue 27 Jan 2015 11:17:18 PM UTC, Key ID 1054b7a24bd6ec30
Source RPM  : puppet-3.7.4-1.el6.src.rpm
Build Date  : Mon 26 Jan 2015 11:48:15 PM UTC
Build Host  : tahoe.delivery.puppetlabs.net
Relocations : (not relocatable)
Vendor      : Puppet Labs
URL         : http://puppetlabs.com
Summary     : A network tool for managing many disparate systems
Description :
Puppet lets you centrally manage every important aspect of your system using a
cross-platform specification language that manages all the separate elements
normally aggregated in different files, like users, cron jobs, and hosts,
along with obviously discrete elements like packages, services, and files.
share|improve this answer
    
Perfect. This is just what I need. –  djhaskin987 Apr 26 '13 at 16:01

Issue less <rpm file> and check the Signature entry, e.g.,:

[vagrant@vm-one ~]$ less artifactory-3.5.3.rpm
Name        : artifactory
Version     : 3.5.3
Release     : 30172
Architecture: noarch
Install Date: (not installed)
Group       : Development/Tools
Size        : 42286184
License     : LGPL
Signature   : (none)
Source RPM  : artifactory-3.5.3-30172.src.rpm
Build Date  : Thu 19 Mar 2015 04:47:04 PM UTC
Build Host  : artbuild2.jfrog.local
Relocations : (not relocatable)
Vendor      : JFrog Ltd.
URL         : http://www.jfrog.org
Summary     : Binary Repository Manager
Description :
The best binary repository manager around.
-rwxrwxr-x    1 root    root                     7891 Mar 19 16:47 /etc/init.d/artifactory
drwxr-xr-x    2 artifactartifact                    0 Mar 19 16:47 /etc/opt/jfrog/artifactory
-rwxrwx---    1 artifactartifact                 9855 Mar 19 16:47 /etc/opt/jfrog/artifactory/artifactory.config.xml
-rwxrwx---    1 artifactartifact                11172 Mar 19 16:47 /etc/opt/jfrog/artifactory/artifactory.system.properties
-rwxrwx---    1 artifactartifact                  457 Mar 19 16:47 /etc/opt/jfrog/artifactory/default
-rwxrwx---    1 artifactartifact                 6858 Mar 19 16:47 /etc/opt/jfrog/artifactory/logback.xml
-rwxrwx---    1 artifactartifact                 5470 Mar 19 16:47 /etc/opt/jfrog/artifactory/mimetypes.xml
drwxrwxr-x    2 root    root                        0 Mar 19 16:47 /opt/jfrog
drwxrwxr-x    2 root    root                        0 Mar 19 16:47 /opt/jfrog/artifactory/bin
-rwxrwxr-x    1 root    root                   103424 Mar 19 16:47 /opt/jfrog/artifactory/bin/artifactory-service.exe
-rwxrwxr-x    1 root    root                     1366 Mar 19 16:47 /opt/jfrog/artifactory/bin/artifactory.bat
-rwxrwxr-x    1 root    root                      457 Mar 19 16:47 /opt/jfrog/artifactory/bin/artifactory.default
artifactory-3.5.3.rpm
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.