• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to check rpm package integrity in Linux

By admin

Sometimes, after we download an rpm package manually, would need to check the package integrity sha1 (md5) or signature to avoid problems once it’s installed or during the installation. Also, we may need to find other package information like vendor, description, summary. This post describes ways to check rpm package integrity as well as package information.

Checking rpm package integrity

Use the command “rpm -K –nosignature [rpm-file]“. For example:

# rpm --checksig sendmail-8.14.7-5.el7.x86_64.rpm
sendmail-8.14.7-5.el7.x86_64.rpm: rsa sha1 (md5) pgp md5 OK <<

The "md5 OK" message displayed means that the file was not corrupted by the download. Also, To see a more verbose message, replace -K with -Kvv in the command. For example:

# rpm -Kvv --nosignature rhn-client-tools-1.0.0.1-45.0.3.el6.noarch.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 246 Header sanity check: OK
D: added key gpg-pubkey-ec551f03-53619141 to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: Expected size: 521888 = lead(96)+sigs(772)+pad(4)+data(521016)
D: Actual size: 521888
rhn-client-tools-1.0.0.1-45.0.3.el6.noarch.rpm:
Header SHA1 digest: OK (97188088ec13fe00b4845fe3ec9bf733cdb4f132)
MD5 digest: OK (96ed25287226d30545906749b5d63901)
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm

View rpm package information

To show information about it, use the following command "rpm -qip [rpm-file]". For example:

# rpm -qip rhn-client-tools-1.0.0.1-45.0.3.el6.noarch.rpm
Name : rhn-client-tools Relocations: (not relocatable)
Version : 1.0.0.1 Vendor: Oracle America
Release : 45.0.3.el6 Build Date: Mon 01 Oct 2018 10:53:34 AM EDT
Install Date: (not installed) Build Host: x86-ol6-builder-04.us.oracle.com
Group : System Environment/Base Source RPM: rhn-client-tools-1.0.0.1-45.0.3.el6.src.rpm
Size : 2837189 License: GPLv2
Signature : RSA/8, Mon 01 Oct 2018 10:53:51 AM EDT, Key ID 72f97b74ec551f03
URL : https://fedorahosted.org/spacewalk
Summary : Support programs and libraries for Unbreakable Linux Network
Description :
Unbreakable Linux Network Client Tools provides programs and libraries to allow your
system to receive software updates from Unbreakable Linux Network.

To show the same information for an already installed package use the command "rpm -qi [rpm-file]". For example:

# rpm -qi rhn-client-tools
Name : rhn-client-tools Relocations: (not relocatable)
Version : 1.0.0.1 Vendor: Oracle America
Release : 45.0.5.el6 Build Date: Wed 09 Jan 2019 09:35:26 AM EST
Install Date: Tue 26 Feb 2019 10:40:04 AM EST Build Host: x86-ol6-builder-05.us.oracle.com
Group : System Environment/Base Source RPM: rhn-client-tools-1.0.0.1-45.0.5.el6.src.rpm
Size : 2827020 License: GPLv2
Signature : RSA/8, Wed 09 Jan 2019 09:36:17 AM EST, Key ID 72f97b74ec551f03
URL : https://fedorahosted.org/spacewalk
Summary : Support programs and libraries for Unbreakable Linux Network
Description :
Unbreakable Linux Network Client Tools provides programs and libraries to allow your
system to receive software updates from Unbreakable Linux Network.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How To Force User/Group Ownership Of Files On A Samba Share
  2. How to Find Number of CPU Sockets on a CentOS/RHEL System
  3. Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7
  4. /proc/cpuinfo file explained
  5. How to configure Partitioned Block Devices (Non-ASMLIB) And Assign Them To ASM
  6. Linux Command line Basics – Executing commands from the command line
  7. How to use the “screen” command in Linux
  8. CentOS / RHEL LVM : Backing Up Volume Group Metadata
  9. Understanding Variables in Bash Shell Under Linux
  10. How to configure and Manage Network Connections using nmcli

You May Also Like

Primary Sidebar

Recent Posts

  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • How Realms Work in Oracle Database Vault
  • How to use Privilege Analysis in Oracle Database
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary