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.rpmIn 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
dnf Command Reference: Flags, Usage & CI ExamplesReference for dnf: install, -y, --setopt=install_weak_deps, remove, clean all, and a CI example that installs…
yum Command Reference: Flags, Usage & CI ExamplesReference for yum: install, -y, remove, makecache, clean all, and a CI example that installs packages noninte…
dpkg Command Reference: Flags, Usage & CI ExamplesReference for dpkg: -i, -r, -l, -L, -S, --configure, and a CI example that installs a local .deb and fixes de…