RPM - Basic Usage

From Notes

Jump to: navigation, search


Querying the RPM Database

Query the RPM database for a specific package:

rpm -q <package>

Query the RPM database for all packages installed:

rpm -qa

Query the rpm database and find out which rpm owns a specific file:

rpm -qf <file>

Working with RPM Files

Determine which packages are required by a specific rpm:

rpm -qpR <package>.rpm

List of files that are in an RPM package:

rpm2cpio <package>.rpm | cpio -t

Extract a single file from an RPM:

rpm2cpio <package>.rpm | cpio –ivd

List information and files from an RPM:

rpm -qlip <package>.rpm

Import the GPG key signature for a repository

Redhat 3 / 4

rpm --import <path to key>

Redhat 7.* / 2

 gpg --import <path to keys>

Other Pages

Building RPMs

Fedora RPM Resource

Common Problems

Problem: yum fails to install complaining about an md5 error.

Answer: the most common cause of this issue is a full partition (/var).

Personal tools