This is an old revision of the document!
RHEL 10 rpm command
Examine installed RPM packages
$ rpm --query --all $ rpm -qa $ rpm -qa | wc -l $ dnf list --installed | wc -l $ rpm -qa "kernel*" $ rpm -q tree $ rpm --help | less
Possible contents of an RPM package
- binary executables
- shared libraries
- man pages/info files/doc files
- configuration files
- data and asset files (templates, icons)
- systemd files
- pre/post install/uninstall scripts
- other package dependencies, suggestions and conflicts
Querying an installed package
General information about the package:
$ rpm -qi setup
Name : setup
Version : 2.14.5
Release : 7.el10
Architecture: noarch
Install Date: Sat 17 Oct 2026 12:17:46 PM
Group : System Environment/Base
Size : 737783
License : LicenseRef-Fedora-Public-Domain
Signature :
RSA/SHA256, Fri 06 Jun 2025 09:44:36 AM, Key ID dee5c11cc2a1e572
RSA/SHA256, Fri 06 Jun 2025 09:44:37 AM, Key ID dee5c11cc2a1e572
Source RPM : setup-2.14.5-7.el10.src.rpm
Build Date : Thu 05 Jun 2025 03:29:25 PM
Build Host : s390x-builder02.almalinux.org
Packager : AlmaLinux Packaging Team <packager@almalinux.org>
Vendor : AlmaLinux
URL : https://pagure.io/setup/
Summary : A set of system configuration and setup files
Description :
The setup package contains a set of important system configuration and
setup files, such as passwd, group, and profile.
Runtime dependencies of the package:
$ rpm -qR rpm
Mapping packages to files and vice versa
List the files in a package (you've seen this before):
$ rpm -ql shadow-utils | less
Identify the package containing a file:
$ rpm -qf /etc/passwd setup-2.14.5-7.el10.noarch $
Verifying/repairing installed packages
$ sudo rpm -Va
Break something:
$ rpm -ql parted ... files ... $ sudo rm /usr/sbin/parted $ sudo rpm -Va missing /usr/sbin/parted $
How to fix:
$ sudo dnf reinstall parted
rpm query/verify options
$ rpm --help
Query/Verify package selection options:
-a, --all query/verify all packages
-f, --file query/verify package(s) owning installed file
--path query/verify package(s) owning path, installed or
not
-g, --group query/verify package(s) in group
-p, --package query/verify a package file
--pkgid query/verify package(s) with package identifier
--hdrid query/verify package(s) with header identifier
-q, --query rpm query mode
--triggeredby query the package(s) triggered by the package
--whatconflicts query/verify the package(s) which conflict with a
dependency
--whatrequires query/verify the package(s) which require a
dependency
--whatobsoletes query/verify the package(s) which obsolete a
dependency
--whatprovides query/verify the package(s) which provide a
dependency
--whatrecommends query/verify the package(s) which recommends a
dependency
--whatsuggests query/verify the package(s) which suggests a
dependency
--whatsupplements query/verify the package(s) which supplements a
dependency
--whatenhances query/verify the package(s) which enhances a
dependency
--nomanifest do not process non-package files as manifests
Query/Verify file selection options:
-c, --configfiles only include configuration files
-d, --docfiles only include documentation files
-L, --licensefiles only include license files
-A, --artifactfiles only include artifact files
--noghost exclude %%ghost files
--noconfig exclude %%config files
--noartifact exclude %%artifact files
... snip ...