Skip to content
Latchkey

rpm Command Reference: Flags, Usage & CI Examples

rpm installs and queries individual RPM packages.

rpm is the low-level RPM package tool that yum and dnf build on. It installs a local .rpm directly and answers queries about installed packages and file ownership.

Common flags and usage

  • -i <file.rpm>: install a package
  • -U <file.rpm>: upgrade (or install) a package
  • -e <pkg>: erase a package
  • -q <pkg>: query whether a package is installed
  • -ql <pkg>: list files a package owns
  • -qf <path>: find which package owns a file

Example

shell
rpm -i ./mytool-1.2.3.x86_64.rpm || dnf install -y ./mytool-1.2.3.x86_64.rpm

In CI

Like dpkg, rpm -i does not resolve dependencies; prefer dnf/yum install on a local file path when dependencies are needed. Use rpm -qf to debug which package provides a binary inside an image.

Key takeaways

  • rpm -i installs a local .rpm without resolving dependencies.
  • Use dnf/yum install on the file when dependencies are needed.
  • rpm -ql and -qf map packages to and from files.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →