RPM(8)

โœจ rpm โ€” RPM Package Manager โœจ

okay bestie, gather round ๐Ÿ’– this is RPM(8), straight outta the System Manager's Manual, and it's literally the whole personality of rpm โ€” the RPM Package Manager. She builds, she installs, she queries, she verifies, she updates, she erases. She does it all and she does it flawlessly. Let's get into it ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

rpm โ€” RPM Package Manager


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

๐Ÿฆ‹ Querying and verifying packages

rpm {-q|--query} [select-options] [query-options] [PACKAGE_FILE ...]
[PACKAGE_NAME ...]
rpm {-V|--verify} [select-options] [verify-options] [PACKAGE_NAME ...]

๐Ÿฆ‹ Installing, upgrading and removing packages

rpm {-i|--install} [transaction-options] [install-options] PACKAGE_FILE
...
rpm {-U|--upgrade} [transaction-options] [install-options] PACKAGE_FILE
...
rpm {-F|--freshen} [transaction-options] [install-options] PACKAGE_FILE
...
rpm --reinstall [transaction-options] [install-options] PACKAGE_FILE ...
rpm --restore [transaction-options] [select-options] PACKAGE_NAME ...
rpm {-e|--erase} [transaction-options] [erase-options] PACKAGE_NAME ...

๐Ÿฆ‹ Misc operations

rpm --querytags

See rpm-common(8) for operations common to all rpm executables. ๐Ÿ‘‘


๐Ÿ’… DESCRIPTION ๐Ÿ’…

okay so rpm is a powerful Package Manager, no cap. She can be used to build, install, query, verify, update, and erase individual software packages. Main character energy, truly.

A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. So the package is like โ€” the files, plus the little lore document explaining the files. Obsessed.

Packages come in two varieties:

  • binary packages โ€” used to encapsulate software to be installed ๐Ÿ“
  • source packages โ€” containing the source code and recipe necessary to produce binary packages ๐Ÿงš

๐Ÿ‘‘ OPERATIONS ๐Ÿ‘‘

๐ŸŒˆ Querying and verifying packages

  • -V, --verify โ€” Verify package(s), comparing information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. Among other things, verifying compares the size, digest, permissions, type, owner and group of each file. Any discrepancies are displayed. She's doing a full vibe check on your files, basically ๐Ÿ”
  • -q, --query โ€” Query package files or installed package(s). Ask her anything, she'll tell you ๐Ÿ’…

๐ŸŒˆ Installing, upgrading and removing packages

  • -i, --install โ€” Install new package(s) without considering upgrade scenarios. Heads up bestie, this is considered special usage โ€” normally installations should be done with --upgrade.
  • -U, --upgrade โ€” Install or upgrade package(s) to a newer version. Old and/or obsoleted package(s) are removed after the new package is installed. Glow-up achieved โœจ
  • -F, --freshen โ€” Upgrade package(s), but only ones for which an earlier version is installed. She's selective, she's picky, she ate.
  • --reinstall โ€” Reinstall previously installed package(s). Round two, no notes.
  • --restore โ€” Restore file metadata such as timestamp, owner, group, permissions and capabilities of files of installed package(s). Turning back the clock on your file metadata, iconic ๐ŸŒธ
  • -e, --erase โ€” Erase installed packages. bye bestie ๐Ÿซถ

๐ŸŒˆ Misc operations

  • --querytags โ€” Dump known querytags. Useful with the --queryformat option. She's dumping everything she knows, and she knows a lot.

๐ŸŒˆ Obsolete compatibility aliases

okay so these are obsolete popt(3) aliases for backwards compatibility only, and their use is discouraged. Like wearing low-rise jeans to a 2025 party. It's giving y2k, but not in a cute way ๐Ÿ™ˆ

  • --initdb, --rebuilddb, --verifydb โ€” See rpmdb(8).
  • --addsign, --delsign, --resign โ€” See rpmsign(1).
  • -K, --checksig, --import โ€” See rpmkeys(8).
  • --specfile โ€” See rpmspec(1).

See rpm-common(8) for the operations common to all rpm executables.


๐Ÿงš ARGUMENTS ๐Ÿงš

  • PACKAGE_FILE โ€” Either an rpm package or an rpm-manifest(5) file. May also be specified as an ftp or http URL, in which case the package will be downloaded before being installed. See FTP/HTTP OPTIONS for information on rpm's ftp and http client support. She'll go get it herself, periodt ๐Ÿ’…
  • PACKAGE_NAME โ€” Installed package named PACKAGE_NAME. To specify the package more precisely the package name may be followed by the version or version and release both separated by a dash, or an architecture name separated by a dot. See the output of rpm -qa or rpm -qp PACKAGE_FILE as an example. Precision is the moment ๐ŸŽ€

๐Ÿ’– OPTIONS ๐Ÿ’–

See rpm-common(8) for the options common to all operations. Those ones are shared, these ones are her specials.


๐Ÿ”ฅ INSTALL AND UPGRADE OPTIONS ๐Ÿ”ฅ

  • --allfiles โ€” Installs or upgrades all the missingok files in the package, regardless if they exist.
  • --badreloc โ€” Used with --relocate, permit relocations on all file paths, not just those OLDPATH's included in the binary package relocation hint(s).
  • --excludepath OLDPATH โ€” Don't install files whose name begins with OLDPATH.
  • --excludeartifacts โ€” Don't install any files which are marked as artifacts, such as build-id links.
  • --excludeconfigs, --noconfigs โ€” Do not install configuration files.
  • --excludedocs โ€” Don't install any files which are marked as documentation (which includes man pages and texinfo documents). yes this includes man pages, yes that's a little self-referential, yes it's funny ๐Ÿ˜ญ
  • --force โ€” Same as using --replacepkgs, --replacefiles, and --oldpackage.
  • --ignoresize โ€” Don't check mount filesystems for sufficient disk space before installing this package. Living dangerously, fr fr.
  • --ignorearch โ€” Allow installation or upgrading even if the architectures of the binary package and host don't match.
  • --ignoreos โ€” Allow installation or upgrading even if the operating systems of the binary package and host don't match.
  • --includedocs โ€” Install documentation files. This is the default behavior.
  • --nocontexts โ€” Don't set SELinux contexts for files and scriptlets. Only effective if rpm-plugin-selinux(8) is installed and active.
  • --nocaps โ€” Don't set file capabilities.
  • --noverify โ€” Don't perform verify package files prior to installation.
  • --nosysusers โ€” Don't create rpm-sysusers(7) from packages
  • --oldpackage โ€” Allow an upgrade to replace a newer package with an older one. Downgrade era, we love a throwback โœจ
  • --prefix NEWPATH โ€” For relocatable binary packages, translate all file paths that start with the installation prefix in the package relocation hint(s) to NEWPATH.
  • --relocate OLDPATH=NEWPATH โ€” For relocatable binary packages, translate all file paths that start with OLDPATH in the package relocation hint(s) to NEWPATH. This option can be used repeatedly if several OLDPATH's in the package are to be relocated.
  • --replacefiles โ€” Install the packages even if they replace files from other, already installed, packages.
  • --replacepkgs โ€” Install the packages even if some of them are already installed on this system.

๐Ÿ’€ ERASE OPTIONS ๐Ÿ’€

  • --allmatches โ€” Remove all versions of the package which match PACKAGE_NAME. Normally an error is issued if PACKAGE_NAME matches multiple packages. So like, normally she panics if you're ambiguous, but with this flag? She takes them all out. Dramatic ๐Ÿซถ

๐ŸŒŸ TRANSACTION OPTIONS ๐ŸŒŸ

The transaction options are common to --install, --upgrade, --reinstall and --erase operations. Shared queen behavior.

  • --deploops โ€” Print dependency loops as warnings.
  • -h, --hash โ€” Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display. 50 little #'s going by, so satisfying, lowkey hypnotic ๐Ÿ’…
  • --justdb โ€” Update only the database, not the filesystem.
  • --nodb โ€” Update only the filesystem, not the database.
  • --nodeps โ€” Don't check dependencies before uninstalling the packages.
  • --noorder โ€” Don't reorder the packages for an install. The list of packages would normally be reordered to satisfy dependencies.
  • --noplugins โ€” Do not load and execute plugins.
  • --noscripts โ€” Disables execution of package scriptlets. Equivalent to
--nopre --nopost --nopreun --nopostun --nopretrans --noposttrans
--nopreuntrans --nopostuntrans
  • --nopre --nopost --nopreun --nopostun --nopretrans --noposttrans --nopreuntrans --nopostuntrans โ€” Don't execute the scriptlets of the named type.
  • --notriggers โ€” Disable execution of package triggers. Equivalent to
--notriggerprein --notriggerin --notriggerun --notriggerpostun
  • --notriggerin --notriggerun --notriggerprein --notriggerpostun โ€” Disable execution of the trigger scriptlets of the named type.
  • --percent โ€” Print percentages as files are unpacked from the package archive. This is intended to make rpm easy to run from other tools.
  • --test โ€” Don't really execute anything, just go through the motions. Useful in conjunction with the -vv option for debugging. She's doing a little dress rehearsal, no real consequences ๐ŸŒˆ

๐Ÿ“ QUERY OPTIONS ๐Ÿ“

  • --qf QUERYFMT, --queryformat QUERYFMT โ€” Output format of each queried package, as described by rpm-queryformat(7). If omitted, uses the format defined by %_query_all_fmt in rpm-config(5).

There are three subsets of options for querying: package selection, file selection and information selection.

โœจ PACKAGE SELECTION OPTIONS โœจ

okay so these are the ones that decide which packages we're even talking about. choosing your faves, basically. ๐Ÿ’…

  • -a, --all [SELECTOR ...] โ€” queries all the installed packages. and yes bestie, you can narrow it down with optional SELECTORs in the form tag=pattern, like name="b*" to grab packages whose name starts with b. slay.
  • --dupes โ€” lists duplicated packages. (yes. dupes. as in, more than one. we don't judge. ๐Ÿ™ˆ)
  • -f, --file FILE โ€” query which package owns the installed FILE.
  • --filecaps โ€” lists filenames along with their POSIX1.e capabilities.
  • --fileclass โ€” lists filenames with their classes (that's libmagic classification, iykyk).
  • --filecolor โ€” lists filenames with their colors. the vibes are: 0 for noarch, 1 for 32bit, 2 for 64 bit. ๐ŸŽจ
  • --fileprovide โ€” lists filenames with their provides.
  • --filerequire โ€” lists filenames with their requires.
  • -g, --group GROUP โ€” query packages that live in the group GROUP.
  • --noglob โ€” don't glob arguments when installing package files. no wildcards, no chaos.
  • --nomanifest โ€” don't process non-package files as rpm-manifest(5) files.
  • -p, --package PACKAGE_FILE โ€” query an (uninstalled!) package PACKAGE_FILE. it's giving window shopping. ๐Ÿ›๏ธ
  • --path PATH โ€” query the package(s) that own PATH, whether the file is installed or not. heads up: multiple packages can own a PATH, but the file is only owned by the package installed last. periodt.
  • --querybynumber HDRNUM โ€” query the HDRNUM database entry directly. honestly only useful for debugging, ngl.
  • --specfile SPECFILE โ€” obsolete. use rpmspec(1) instead. it's retired, bestie, let it rest. ๐Ÿ’€
  • --tid TID โ€” query package(s) that have a given TID transaction identifier. fun fact: a UNIX timestamp is currently used as a transaction identifier, and every package installed or erased within a single transaction shares a common identifier. friend group behavior fr fr.
  • --triggeredby PACKAGE_NAME โ€” query packages that get triggered by package(s) PACKAGE_NAME.
  • --whatobsoletes CAPABILITY โ€” query all packages that obsolete CAPABILITY for proper functioning.
  • --whatprovides CAPABILITY โ€” query all packages that provide the CAPABILITY capability.
  • --whatrequires CAPABILITY โ€” query all packages that require CAPABILITY for proper functioning.
  • --whatconflicts CAPABILITY โ€” query all packages that conflict with CAPABILITY.
  • --whatrecommends CAPABILITY โ€” query all packages that recommend CAPABILITY.
  • --whatsuggests CAPABILITY โ€” query all packages that suggest CAPABILITY.
  • --whatsupplements CAPABILITY โ€” query all packages that supplement CAPABILITY.
  • --whatenhances CAPABILITY โ€” query all packages that enhance CAPABILITY.

๐Ÿ’– PACKAGE QUERY OPTIONS ๐Ÿ’–

the "tell me everything about this package" girlies. ๐Ÿ’…

  • --changelog โ€” displays change information for the package.
  • --changes โ€” same energy, but with full timestamps. โœจ
  • --conflicts โ€” lists capabilities this package conflicts with. drama. ๐ŸŒธ
  • --dump โ€” dumps file information in exactly this order (and yes, it implies -l):
path size mtime digest mode owner group isconfig isdoc rdev symlink
  • --enhances โ€” lists capabilities enhanced by package(s).
  • --filesbypkg โ€” lists all the files in each selected package.
  • --filetriggers โ€” lists filetrigger scriptlets from package(s).
  • -i, --info โ€” displays package information, including name, version, and description. and it uses the --queryformat if one was specified. ๐Ÿ‘‘
  • --last โ€” orders the package listing by install time so the latest packages are at the top. freshest first, as they should be.
  • -l, --list โ€” lists files in the package.
  • --obsoletes โ€” lists packages this package obsoletes.
  • --provides โ€” lists capabilities this package provides.
  • --recommends โ€” lists capabilities recommended by package(s).
  • -R, --requires โ€” lists capabilities on which this package depends.
  • --suggests โ€” lists capabilities suggested by package(s).
  • --supplements โ€” lists capabilities supplemented by package(s).
  • --scripts โ€” lists the package specific scriptlet(s) used as part of the installation and uninstallation processes.
  • -s, --state โ€” displays the states of files in the package (implies -l). each file's state is one of normal, not installed, or replaced.
  • --triggers, --triggerscripts โ€” displays the trigger scripts, if any, contained in the package.
  • --xml โ€” formats package headers as XML.

๐Ÿฆ‹ FILE SELECTION OPTIONS ๐Ÿฆ‹

picking and choosing which files get to come to the party.

  • -A, --artifactfiles โ€” only include artifact files (implies -l).
  • -c, --configfiles โ€” only include configuration files (implies -l).
  • -d, --docfiles โ€” only include documentation files (implies -l).
  • -L, --licensefiles โ€” only include license files (implies -l).
  • --noartifact โ€” excludes artifact files.
  • --noconfig โ€” excludes config files.
  • --noghost โ€” excludes ghost files. ๐Ÿ‘ป (sorry, had to)

๐ŸŽ€ VERIFY OPTIONS ๐ŸŽ€

okay so the package and file selection options here are the same as for package querying โ€” including rpm-manifest(5) files as arguments, yes really. the options that are unique to verify mode are these:

  • --nodeps โ€” don't verify dependencies of packages.
  • --nodigest โ€” don't verify package or header digests when reading.
  • --nofiles โ€” don't verify any attributes of package files.
  • --noscripts โ€” don't execute the %verifyscript scriptlet (if any).
  • --nosignature โ€” don't verify package or header signatures when reading.
  • --nolinkto โ€” don't verify the corresponding file attribute.
  • --nofiledigest (formerly --nomd5) โ€” don't verify the corresponding file attribute.
  • --nosize โ€” don't verify the corresponding file attribute.
  • --nomtime โ€” don't verify the corresponding file attribute.
  • --nomode โ€” don't verify the corresponding file attribute.
  • --nordev โ€” don't verify the corresponding file attribute.
  • --nouser, --nogroup โ€” don't verify file user/group ownership. โš ๏ธ note that only local passwd(5) and group(5) databases are consulted. so no, your LDAP bestie isn't getting a vote here.
  • --nocaps โ€” don't verify file capabilities.

๐ŸŒˆ OUTPUT ๐ŸŒˆ

  • --verify โ€” the format of the output is a string of 9 result characters, one possible attribute each from the package, followed by the filename.

each of those 9 characters denotes the result of comparing attribute(s) of the file to the value of those attribute(s) recorded in the database.

a single . (period) means the test passed. a single ? (question mark) means the test could not be performed (e.g. file permissions prevent reading). otherwise, the (mnemonically emBoldened) character denotes failure of the corresponding --verify test:

  • S โ€” file Size differs
  • M โ€” Mode differs (includes permissions and file type)
  • 5 โ€” digest (formerly MD5 sum) differs
  • D โ€” Device major/minor number mismatch
  • L โ€” readLink(2) path mismatch
  • U โ€” User ownership differs
  • G โ€” Group ownership differs
  • T โ€” mTime differs
  • P โ€” caPabilities differ

and here's the attribute legend, the little letters that show up next to files:

  • a โ€” %artifact โ€” an implicit side-effect file (eg. build-id links)
  • c โ€” %configuration file
  • d โ€” %documentation file
  • g โ€” %ghost file
  • l โ€” %license file
  • m โ€” %missingok โ€” file missing is not a verify failure
  • n โ€” %config(noreplace) โ€” do not replace (a %config file)
  • r โ€” %readme file
  • s โ€” rpm-spec(5) file in a source package

โญ EXIT STATUS โญ

on success, 0 is returned. otherwise, a nonzero failure code. that's it, that's the whole vibe check. ๐Ÿซถ


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

vanillest of them all

rpm -Uvh hello-2.0-1.noarch.rpm

install or upgrade the hello-2.0-1.noarch.rpm package with verbose output and progress meters. and honestly? -Uvh is probably the most common of all the rpm operations. the main character. ๐Ÿ‘‘

alternative root situation

rpm -Uvh --excludedocs --root /srv/test mydist-23.mft

installs the packages described by the mydist-23.mft rpm-manifest(5) file into the alternative system root at /srv/test, excluding all documentation files. bye docs, love you tho. ๐Ÿ’–

freshen up

rpm -Fvh *.rpm

freshens installed packages from a local directory, with verbose output and progress meters.

kernel moment

rpm -i kernel-6.15.4-200.x86_64.rpm

installs the kernel-6.15.4-200.x86_64.rpm package quietly. on some Linux distributions, different kernel versions are intended to be installed in parallel like this, without erasing older ones, so there's always a bootable kernel in case of problems. it's one of the few cases where -i is the right thing to use. rare -i W.

erase 'em all

rpm -evh --allmatches libhello

erases all versions of the package libhello on the system, with verbose output and progress meters. typically there's only one version of a package installed at a time, but in some cases it's possible to have different versions or different architectures of a package installed in parallel โ€” in which case --allmatches can be handy. no cap.

the oopsie fixer

rpm -vh --reinstall hello-2.0-1.noarch.rpm

reinstalls a previously installed hello-2.0-1.noarch.rpm package, with verbose output and progress labels. useful if eg. the files of a package get corrupted or erased accidentally. we've all been there bestie. ๐Ÿ˜ญ

restore the perms

rpm -v --restore --all

restores permissions of files in all installed packages to their packaged specifications, with verbose output.

verify but skip the configs

rpm --verify --noconfig openssh-server

verifies the integrity of the installed openssh-server package, ignoring changes in configuration. because yes, you edited it, and no, we don't care.

list it ALL

rpm -qa

lists all installed packages, using the default formatting.

ls vibes

rpm -qlv --noartifact glibc

lists the files of the glibc package in a style similar to the ls(1) command output with ls -l, omitting "artifact" files such as build-id's which are not usually the main interest.

filenames + digests

rpm -q --qf "[%{filenames} %{filedigests}\n]" openssh-server

lists filenames and their corresponding digests of the installed openssh-server package. ๐Ÿงš

peek before you install, PLEASE

rpm -qp --scripts --triggers --filetriggers myserver-1.0-1.x86_64.rpm

shows all scriptlets and triggers from the myserver-1.0-1.x86_64.rpm package file.

bestie. before installing unknown packages, at least do this! ๐Ÿ™ˆ it's the bare minimum and it takes two seconds.

macro expansion

rpm --target ppc64le --eval "%optflags"

prints the expansion of the %optflags macro for the ppc64le architecture.


๐ŸŒธ FILES ๐ŸŒธ

see rpm-common(8), rpm-config(5) and rpm-rpmrc(5). they hold the deets. ๐ŸŽ€


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

rpm-common(8), popt(3), rpm2cpio(1), rpmbuild(1), rpmdb(8), rpmkeys(8), rpmsign(1), rpmspec(1), rpm-queryformat(7) rpm-manifest(5) rpm-version(7) rpm-plugins(8)

rpm --help โ€” as rpm supports customizing the options via popt aliases, it's impossible to guarantee that what's described in the manual matches what's actually available. so likeโ€ฆ read the manual, but also, you know. ๐Ÿ‘€

http://www.rpm.org/


and that's a wrap on our lil RPM(8) hangout!! this whole thing is RPM 6.1.0, dated 2026-08-20 โ€” go forth and rpm responsibly bestie, ily, bye!! ๐Ÿ’…โœจ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from