Updated: 28 September 2026 · Applies to: RPM 4.16 to 6.0 on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Fedora 44
rpm is the low-level package tool of the Red Hat family. It installs, queries, verifies and removes .rpm files, but it does not download anything or resolve dependencies. For everyday installs, use dnf, which calls rpm for you. rpm is most useful for questions such as "which package owns this file?" or "has this file been changed?".
Install and remove
- For a downloaded package, let dnf resolve its dependencies:
dnf install ./package.rpm
- With rpm alone (fails if a dependency is missing):
rpm -ivh package.rpm # install rpm -Uvh package.rpm # upgrade, or install if not present rpm -Fvh package.rpm # upgrade only if an older version is installed rpm -e package # remove (use the package name, not the file name)
-vshows the file name and-ha progress bar. - To fetch a package file from the repositories without installing it:
dnf download tree
Look inside a package file before installing
rpm -qpi package.rpm # description, version, vendor rpm -qpl package.rpm # files it will install rpm -qpR package.rpm # what it needs rpm -K package.rpm # check its digests and signature
rpm -K should end with "digests signatures OK". If it reports a missing key, import the vendor's key only from a source you trust, for example rpm --import https://vendor.example/RPM-GPG-KEY.
Query installed packages
rpm -qa # all installed packages rpm -q openssh-server # is it installed, and which version? rpm -qi openssh-server # details rpm -ql openssh-server # its files rpm -qc openssh-server # its configuration files rpm -qd openssh-server # its documentation rpm -qf /usr/bin/tree # which package owns this file? rpm -q --changelog openssh-server | head
rpm -qf only knows files that are installed. For a file you do not have yet, ask the repositories instead: dnf provides '*/bin/dig'.
Verify files
rpm -V openssh-server # one package rpm -Va # every package (takes a while)
No output means nothing changed. Otherwise each line shows a code and the file, for example S.5....T. /usr/bin/tree: S size, 5 checksum, T modification time, M permissions, U and G owner and group. A c before the file name marks a configuration file, which you may have changed on purpose. Changed programs under /usr/bin or /usr/sbin deserve a closer look.
Common problems
- "Failed dependencies": install with
dnf install ./package.rpminstead, which fetches what is missing. - "package is already installed": use
rpm -Uvhto upgrade, ordnf reinstall packageto reinstall the same version. - "error: rpmdb open failed" or a hanging rpm: see our guide on recovering a corrupt RPM database.
Official documentation: RPM documentation.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
