Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

DNF

Direct answer

DNF is the package manager for RPM-based distributions (replacing YUM): it installs, updates and removes packages with dependency resolution, and manages repositories, groups and modules.

When to use this

Use it for package work on RHEL/Rocky/AlmaLinux/Fedora, or when dnf reports conflicts or missing dependencies.

First 30 seconds

1. dnf check-update.

2. Error "nothing provides …" → dnf repoquery --whatprovides '<cap>' — which repo has it?

3. Conflicts → disable the extra repo for this transaction (--disablerepo=).

4. Stale metadata → dnf clean all && dnf makecache.

5. dnf history undo <id> to roll back.

Operational verification

dnf reads repo metadata → resolves → downloads → rpm transaction → history entry

Evidence · next step

For Package Management → RHEL / Rocky / AlmaLinux → DNF, continue with the first unproven Topic check: Record enabled repositories, metadata state and module/stream context for the package. If that boundary is healthy, advance to the adjacent check: Compare installed and available NEVRA with repository origin and exclusions/versionlocks. 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 for package work on RHEL/Rocky/AlmaLinux/Fedora, or when dnf reports conflicts or missing dependencies.
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

repo config + exclusions/versionlock/modules → metadata cache → NEVRA candidates → dependency solver → transaction plan → download/signature → RPM transaction → DNF history → runtime/workload verification

Healthy evidence: DNF metadata and policy select the expected NEVRA, planned changes are understood, transaction history matches RPM state and workload validation passes.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Record enabled repositories, metadata state and module/stream context for the package.

  • Compare installed and available NEVRA with repository origin and exclusions/versionlocks.
  • Review the complete transaction plan and capture transaction ID/history.
  • Verify RPM database plus affected runtime and workload after execution.

Verification chain. repo config + exclusions/versionlock/modules → metadata cache → NEVRA candidates → dependency solver → transaction plan → download/signature → RPM transaction → DNF history → runtime/workload verification

Step 3 Commands Verify boundary
dnf install nginx
dnf info nginx
dnf provides /usr/sbin/ss
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: exclusions, versionlocks, module streams or unexpected repo priority select a different package while operators only inspect the requested package name.

Step 5 Common mistakes Narrow the fault
  • dnf update on production without testing.
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

dnf check-update lists updates; dnf upgrade --security only security updates (RHEL). Conflicts usually come from mixing repositories — check with dnf repoquery --whatprovides. dnf clean all fixes stale metadata.

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

Show enabled repositories and metadata before focusing on the solver. Resolve the exact package NEVRA, architecture, repository and module/stream context where applicable. Review planned install/upgrade/downgrade/removal changes, then correlate DNF history with RPM database state. A completed DNF transaction can still require service restart, reboot or application-level validation.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

DNF evidence shows solver and transaction orchestration, not independently the correctness of RPM scriptlets, service state or application behavior.

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

DNF in depth: transactions, history and exit codes

DNF resolves dependencies and records every change as a transaction. The DNF command reference documents behaviour that matters in daily operation:

  • check-update exits with 100 when updates are available, 0 when there are none, and 1 on error. That makes it useful in monitoring.
  • history list, history info and history undo show and reverse transactions.
  • --refresh marks the metadata as expired before running.
  • remove --oldinstallonly removes old kernels, keeping the newest ones and the running kernel.
  • distro-sync upgrades or downgrades packages to match the repositories.

The reference notes that modularity is deprecated, and will be removed in a future release of DNF5.

Everyday commands

TaskCommand
Installdnf install pkg
Reinstall a damaged packagednf reinstall pkg
Downgradednf downgrade pkg
Which package provides a file or commanddnf provides '*/bin/dig'
Show transaction detailsdnf history info 42
Undo a transactiondnf history undo 42
Groupsdnf group install "Development Tools"
Clean cachesdnf clean all

Key settings (configuration reference)

Setting in /etc/dnf/dnf.confDefaultMeaning
installonly_limit3Kernel versions kept (minimum 2)
clean_requirements_on_removeTrueRemove unneeded dependencies
keepcacheFalseKeep downloaded packages
bestFalseWhen True, fail instead of choosing an older version

DNF4 and DNF5

Fedora 41 and later use DNF5, a rewrite with mostly compatible commands, while RHEL 9 uses DNF4. Some options and plugins differ. Check dnf --version before writing automation that should run on both.

host$ sudo dnf check-update -q; echo "exit=$?"
openssl.x86_64     1:3.2.2-6.el9_5     baseos
exit=100
host$ dnf provides '*/bin/dig'
bind-utils-32:9.16.23-24.el9_5.x86_64 : Utilities for querying DNS name servers
host$ sudo dnf history info last | grep -E "Transaction ID|Command Line|Upgrade|Install" | head -5
host$ sudo dnf history undo last
host$ grep installonly_limit /etc/dnf/dnf.conf
installonly_limit=3
host$ sudo dnf remove --oldinstallonly --setopt installonly_limit=2 kernel
host$ dnf --version | head -1

Rolling back a change

dnf history undo reverses the package changes of one transaction. It needs the old package versions to still be available in the repositories or the cache. For larger changes, an LVM or VM snapshot is a more reliable rollback.

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

DNF is part of Package Management → RHEL / Rocky / AlmaLinux → DNF. DNF is the modern RHEL-family dependency solver and transaction frontend, combining repository metadata, package NEVRA/version comparison, dependency/conflict solving, transaction history and RPM execution.

Topic-specific state model. DNF is the modern RHEL-family dependency solver and transaction frontend, combining repository metadata, package NEVRA/version comparison, dependency/conflict solving, transaction history and RPM execution.

Interpretation rule. - DNF check-update/list result ≠ package installed state.

  • Available NEVRA ≠ selected/installed NEVRA.
  • Transaction resolved ≠ transaction completed.
  • DNF transaction success ≠ workload healthy or reboot unnecessary.

Quick reference

DNF essentials (dnf 4 on RHEL 8–10; Fedora 41+ uses dnf5 with mostly the same syntax):

dnf install nginx; dnf remove nginx
dnf info nginx; dnf provides /usr/sbin/semanage
dnf list --installed | grep kernel
dnf upgrade --refresh
dnf module list nodejs; dnf module enable nodejs:20     # RHEL 8/9 modularity
dnf versionlock add nginx                               # python3-dnf-plugin-versionlock
dnf clean all; dnf makecache
dnf-automatic: /etc/dnf/automatic.conf (apply_updates = yes, upgrade_type = security)

dnf history info <id> shows exactly what a transaction changed — invaluable after problematic updates.

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. DNF evidence shows solver and transaction orchestration, not independently the correctness of RPM scriptlets, service state or application behavior.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. DNF owns modern RHEL-family repository-aware solving and transaction orchestration. RPM owns local package format/database semantics; Repositories owns source/trust details.

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 → DNF. 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
dnf package managerdnf transactiondnf repository solverdnf history
Embedded reference data

Quick lookup tables

DNF operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDNF is the modern RHEL-family dependency solver and transaction frontend, combining repository metadata, package NEVRA/version comparison, dependency/conflict solving, transaction history and RPM execution.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 chainrepo config + exclusions/versionlock/modules → metadata cache → NEVRA candidates → dependency solver → transaction plan → download/signature → RPM transaction → DNF history → runtime/workload verificationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryDNF evidence proves solver and transaction orchestration, not independently the correctness of RPM scriptlets, service state or application behavior.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux package-management evidence can establish this proof path: repo config + exclusions/versionlock/modules → metadata cache → NEVRA candidates → dependency solver → transaction plan → download/signature → RPM transaction → DNF history → runtime/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. DNF evidence proves solver and transaction orchestration, not independently the correctness of RPM scriptlets, service state or application behavior.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.

DNF · operational reference

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

Reference boundaryDNF
Topic pathPackage Management → RHEL / Rocky / AlmaLinux → DNF
Runtime stateDNF is the modern RHEL-family dependency solver and transaction frontend, combining repository metadata, package NEVRA/version comparison, dependency/conflict solving, transaction history and RPM execution.
Fast checks- Record enabled repositories, metadata state and module/stream context for the package. - Compare installed and available NEVRA with repository origin and exclusions/versionlocks. - Review the complete transaction plan and capture transaction ID/history. - Verify RPM database plus affected runtime and workload after execution.
Verification chainrepo config + exclusions/versionlock/modules → metadata cache → NEVRA candidates → dependency solver → transaction plan → download/signature → RPM transaction → DNF history → runtime/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 boundaryDNF evidence proves solver and transaction orchestration, not independently the correctness of RPM scriptlets, service state or application behavior. 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?