Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

RPM

Direct answer

RPM is the low-level package format and tool on RHEL-family systems: rpm -q queries installed packages, rpm -qi details, rpm -ql files, rpm -qf the owner of a file, and rpm -V verifies files against the package database.

When to use this

Use it to query or verify installed packages, or to check whether files were changed.

First 30 seconds

1. rpm -q <pkg> — installed version.

2. rpm -qf <file> — which package owns it.

3. rpm -V <pkg> — changed files?

4. Signature: rpm -K <file.rpm>.

5. Reinstall changed files: dnf reinstall <pkg>.

Operational verification

package installed → files and checksums recorded in the RPM database → queries and verification use that database

Evidence · next step

For Package Management → RHEL / Rocky / AlmaLinux → RPM, continue with the first unproven Topic check: Capture installed package NEVRA, architecture, vendor/repository provenance where available and install time. If that boundary is healthy, advance to the adjacent check: Query file ownership/provides/dependencies and verify package/file metadata when integrity is in question. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to query or verify installed packages, or to check whether files were changed.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

RPM package header/signature → dependency/capability metadata → transaction/scriptlets → RPM database → packaged files/config state → service/runtime effects → workload verification

Healthy evidence: RPM database and package metadata are consistent with intended NEVRA/provenance, verification anomalies are understood and resulting runtime behavior is accepted.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Capture installed package NEVRA, architecture, vendor/repository provenance where available and install time.

  • Query file ownership/provides/dependencies and verify package/file metadata when integrity is in question.
  • Correlate direct RPM operations with higher-level DNF/YUM history and dependency state.
  • After repair/install, validate configuration, services and original workload behavior.

Verification chain. RPM package header/signature → dependency/capability metadata → transaction/scriptlets → RPM database → packaged files/config state → service/runtime effects → workload verification

Step 3 Commands Verify boundary
rpm -qi openssl
rpm -ql openssl | head
rpm -qf /etc/ssh/sshd_config
rpm -V openssh-server
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: a database entry is treated as evidence that files/configuration are intact, or a direct RPM install introduces unmanaged dependency/provenance drift.

Next check: Continue from the first step that has not been verified: confirm distribution/release and repository trust, inspect candidate/origin and solver policy, correlate the package-manager transaction with dpkg/RPM local state, then test affected services and the original workload before making additional package changes.

Step 5 Common mistakes Narrow the fault
  • Installing RPMs with rpm -i and missing dependencies (use dnf).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Install with dnf rather than rpm -i so dependencies are resolved. rpm -V <pkg> shows changed files (S size, 5 checksum, M mode). rpm --import adds signing keys.

Key checks
  • apt policy <pkg> / dnf info <pkg> — installed and candidate versions
  • dpkg -l <pkg> / rpm -q <pkg> — installed package
  • apt-cache depends <pkg> / dnf repoquery --requires <pkg> — dependencies
  • dpkg -S <file> / rpm -qf <file> — package owning a file
ReferenceWhat it is1 section · depth on demand

Core model

Use RPM evidence to answer what is installed locally and what package owns/provides a file/capability. Distinguish package-file signature/header verification from repository policy, and query database state separately from filesystem reality where corruption/tampering is suspected. Direct rpm installation can bypass higher-level repository solving, so dependency and provenance consequences must be explicit.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

RPM shows local package metadata/database and package-file relationships; it does not provide complete repository selection policy or application health evidence.

Close with Verify installed package/file version, running process/library/config state and service behavior, then repeat the original workload after any required controlled restart/reload. and state what the evidence does not show.

In depth

rpm: querying and verifying packages

rpm is the low-level tool beneath DNF. It's mainly useful for queries and for verifying installed files against the package database. The rpm(8) manual page documents the queries:

  • -qa (all packages), -qi (information), -ql (files), -qf (owner of a file), -qc and -qd (configuration and documentation files).
  • --requires, --provides, --changelog and --scripts.

Verify output (manual)

rpm -V compares installed files with the database and prints a nine-character code for each file that differs. A . means the test passed, and ? means it couldn't run.

CharacterMeaning
SSize differs
MMode (permissions or type) differs
5Digest (content) differs
DDevice major/minor mismatch
LSymlink target differs
UOwner differs
GGroup differs
TModification time differs
PCapabilities differ
c (attribute)A configuration file

Install, upgrade, erase (manual)

OptionEffect
-iInstall a new package without considering upgrades
-UInstall or upgrade; older versions are removed afterwards
-FUpgrade only packages that are already installed
-eErase

For normal installs, use DNF. It resolves dependencies from repositories, while rpm -i only reports missing dependencies.

Typical questions answered with rpm

QuestionCommand
Which package installed this file?rpm -qf /usr/sbin/sshd
Which config files does a package have?rpm -qc openssh-server
What do its install scripts do?rpm -q --scripts pkg
When was a package installed?rpm -qi pkg | grep "Install Date", rpm -qa --last | head
Has anything been changed on disk?rpm -Va
host$ rpm -qf /usr/sbin/sshd
openssh-server-8.7p1-43.el9.x86_64
host$ rpm -qc openssh-server
/etc/pam.d/sshd
/etc/ssh/sshd_config
/etc/sysconfig/sshd
host$ rpm -V openssh-server
S.5....T.  c /etc/ssh/sshd_config
host$ sudo rpm -Va 2>/dev/null | grep -v ' c ' | head
..5....T.    /usr/bin/ls
host$ rpm -qa --last | head -3

Reading the verify output

The sshd_config change (c) is expected, because administrators edit configuration files. But ..5....T. on /usr/bin/ls, a non-configuration binary, means its contents changed after installation. Without a known reason, that's a sign of tampering, and worth investigating with rpm -qf and package reinstallation.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

RPM is part of Package Management → RHEL / Rocky / AlmaLinux → RPM. RPM defines the RHEL-family package format and local package database, recording installed package NEVRA, files, capabilities, dependencies, signatures and scriptlet-driven transaction state; RPM itself is not a full repository dependency solver.

Topic-specific state model. RPM defines the RHEL-family package format and local package database, recording installed package NEVRA, files, capabilities, dependencies, signatures and scriptlet-driven transaction state; RPM itself is not a full repository dependency solver.

Technical metadata. Host, distribution/release/codename, architecture, package manager/backend versions, package name + version/NEVRA, installed state, candidate/origin, enabled repositories, repository URL/ID, metadata timestamp, signing/GPG trust, pin/priority/hold/exclude/versionlock/module state, dependency/conflict graph, transaction plan/ID/history, download/integrity result, dpkg/RPM database state, maintainer script/scriptlet result, conffile/config effects, service/restart/reboot impact, original workload result.

Interpretation rule. - RPM database entry ≠ every packaged file still matches expected content.

  • RPM package signature valid ≠ repository policy approved that package.
  • rpm -i/-U success ≠ dependencies and runtime behavior are globally correct.
  • Package owns a path ≠ current path content necessarily matches package payload.

Quick reference

RPM low-level commands:

rpm -qa | sort | head
rpm -qi openssh-server
rpm -ql openssh-server; rpm -qc openssh-server      # files / config files
rpm -qf /etc/ssh/sshd_config
rpm -q --changelog openssl | head
rpm -V openssh-server                                # verify against package database
rpm -Va | grep -v '^.......T.'                       # whole system, ignoring mtime-only changes
rpm --import RPM-GPG-KEY; rpm -K package.rpm         # check signature
rpm2cpio pkg.rpm | cpio -idmv                        # extract without installing

rpm -V codes: S size, 5 digest, M mode, U/G owner/group, T mtime — useful for detecting tampered binaries.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. RPM shows local package metadata/database and package-file relationships; it does not provide complete repository selection policy or application health evidence.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. RPM owns package format, NEVRA, local package database, file ownership/provides and scriptlet transaction semantics. DNF/YUM own repository-aware dependency solving.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Package Management → RHEL / Rocky / AlmaLinux → RPM. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.debian.org/doc/manuals/debian-reference/ch02.en.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
rpm package databaserpm nevrarpm package verificationrpm file ownership
Embedded reference data

Quick lookup tables

RPM operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for RPM.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateRPM defines the RHEL-family package format and local package database, recording installed package NEVRA, files, capabilities, dependencies, signatures and scriptlet-driven transaction state; RPM itself is not a full repository dependency solver.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + distribution/release + architecture → identify exact package/version request → enumerate effective repositories/trust → refresh/inspect metadata → compare installed versus candidate/origin → review dependency/conflict transaction → capture package-manager transaction → verify local package database/files/scripts → inspect service/reboot/config effects → repeat original workload test.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainRPM package header/signature → dependency/capability metadata → transaction/scriptlets → RPM database → packaged files/config state → service/runtime effects → workload verificationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryRPM proves local package metadata/database and package-file relationships; it does not provide complete repository selection policy or application health proof.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux package-management evidence can establish this proof path: RPM package header/signature → dependency/capability metadata → transaction/scriptlets → RPM database → packaged files/config state → service/runtime effects → workload verificationUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured repository, solver, transaction, local package database, runtime-side-effect or workload scope. RPM proves local package metadata/database and package-file relationships; it does not provide complete repository selection policy or application health proof.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: confirm distribution/release and repository trust, inspect candidate/origin and solver policy, correlate the package-manager transaction with dpkg/RPM local state, then test affected services and the original workload before making additional package changes.Continue to the next unresolved boundary while preserving the original test condition.

RPM · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryRPM
Topic pathPackage Management → RHEL / Rocky / AlmaLinux → RPM
Runtime stateRPM defines the RHEL-family package format and local package database, recording installed package NEVRA, files, capabilities, dependencies, signatures and scriptlet-driven transaction state; RPM itself is not a full repository dependency solver.
Fast checks- Capture installed package NEVRA, architecture, vendor/repository provenance where available and install time. - Query file ownership/provides/dependencies and verify package/file metadata when integrity is in question. - Correlate direct RPM operations with higher-level DNF/YUM history and dependency state. - After repair/install, validate configuration, services and original workload behavior.
Verification chainRPM package header/signature → dependency/capability metadata → transaction/scriptlets → RPM database → packaged files/config state → service/runtime effects → workload verification Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryRPM proves local package metadata/database and package-file relationships; it does not provide complete repository selection policy or application health proof. Boundary chain: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?