Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Package Management

Direct answer

Package management installs, updates and removes software from trusted repositories, resolving dependencies: APT/dpkg on Debian and Ubuntu, DNF/RPM on RHEL, Rocky, AlmaLinux and Fedora.

When to use this

Use it as the entry point for installing software, applying updates, or fixing package errors.

First 30 seconds

1. Which family? cat /etc/os-release.

2. Metadata refresh without errors?

3. Simulate: apt -s upgrade / dnf upgrade --assumeno.

4. Apply and review the transaction.

5. Services restarted where needed (needrestart / dnf needs-restarting -r).

Operational verification

repositories → signed metadata → dependency resolution → download → install → history recorded

Evidence · next step

For Package Management, continue with the first unproven Topic check: Identify distribution/release, architecture, package manager and exact package/version request. If that boundary is healthy, advance to the adjacent check: Capture enabled repositories, metadata age/trust state and the proposed transaction before changing anything. 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 · Linux · distribution/version specific
Scope / prerequisiteUse it as the entry point for installing software, applying updates, or fixing package errors.
What next?3 suggested next steps
Child topics (this level)3
Evidence2
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.

7 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

distribution/release + architecture → repository configuration/trust → metadata refresh → dependency solver/transaction plan → package download + integrity/signature checks → local package database transaction → files/scripts/configuration → runtime/service effects → workload verification

Healthy evidence: repository metadata is trusted/current, the solver selects the intended versions, the transaction commits cleanly, local package state matches intent and the affected workload passes its acceptance check.

Step 2 Operational verification Verify boundary

Package metadata, repositories, updates, dependency state and package troubleshooting.

Fast verification

- Compare installed/candidate versions (apt policy/dnf info) and inspect held or pinned packages.

- Resolve the first dependency/repository error; repeated retries rarely change the dependency graph.

Step 3 Verification and output interpretation Verify boundary

Verification path. Show repository reachability and metadata freshness, candidate/version selection, transaction result and package database state. Then verify file ownership/checksums where needed and the running consumer version separately. For dependency conflicts, capture the exact solver explanation and enabled repositories rather than deleting packages ad hoc. After library updates, identify long-running processes that still map the previous inode/version before declaring the update operationally complete.

Existing fast checks for this Topic. - Identify distribution/release, architecture, package manager and exact package/version request.

  • Capture enabled repositories, metadata age/trust state and the proposed transaction before changing anything.
  • Verify local package database state and deployed version/files after the transaction.
  • Repeat the original workload/health test and review service/reboot/configuration side effects.

Verification chain. distribution/release + architecture → repository configuration/trust → metadata refresh → dependency solver/transaction plan → package download + integrity/signature checks → local package database transaction → files/scripts/configuration → runtime/service effects → workload verification

Step 4 Commands Verify boundary
apt update && apt list --upgradable
dnf check-update
rpm -qa | sort | head
dpkg -l | grep openssl
Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: operators treat a successful package command as complete evidence while stale metadata, wrong repository origin, pending reboot/service restart or broken workload state remains.

It does not show behavior outside the captured repository, solver, transaction, local package database, runtime-side-effect or workload scope. Package-management evidence shows only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself show the resulting service, application or security outcome.

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 6 Quality lift: branching diagnosis Narrow the fault

Concrete boundaries: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload.

Step 7 Common mistakes Narrow the fault
  • Mixing package managers or repositories from different releases.
  • Upgrading production without testing.
Evidence references

Evidence · 2 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 · 1command output · 1
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Refresh metadata first, keep repositories signed and supported, never force installs, and review what an upgrade will change. Keep the history (/var/log/apt/history.log, dnf history) for rollback and audits.

Key checks
  • apt update / dnf makecache — refresh metadata
  • apt list --upgradable / dnf check-update — pending updates
  • apt policy <pkg> / dnf info <pkg> — versions and source repository
  • dnf history / less /var/log/apt/history.log — past transactions
ReferenceWhat it is3 sections · depth on demand

Operational scope

Package metadata, repositories, updates, dependency state and package troubleshooting.

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.

What it is

Package metadata, repositories, updates, dependency state and package troubleshooting.

Core model

Start by pinning distribution/release, architecture, enabled repositories and the exact requested package/action. Separate repository metadata refresh from dependency solving, download from signature/trust verification, transaction planning from local database commit, package installation from service activation, and package state from the original application outcome. Preserve the transaction log and package versions before remediation so rollback or comparison remains possible.

ReferenceWhy it matters3 sections · depth on demand

When to use it

Use Packages & Repositories when the problem concerns Linux runtime, services, networking, identity, packages, storage or shell automation.

Why it matters operationally

The useful outcome is not simply knowing a definition; it is being able to decide whether Packages & Repositories is healthy, misconfigured, missing, or only a symptom of a failure somewhere else.

Quality lift: concrete internals

Package Management quality lift — inspect the concrete Linux package transaction and effective runtime mechanics rather than treating existing coverage as completion. Package management resolves repositories/metadata, dependency/version constraints, downloads/verifies artifacts, executes package scripts and updates files/database. Transaction success does not show the service reloaded, the expected binary is first in PATH, or running processes use the new library/config. Repository metadata and installed-state databases are different evidence layers.

ReferenceHow it works1 section · depth on demand

How it works

Package metadata, repositories, updates, dependency state and package troubleshooting.

ReferenceImportant terms & boundaries4 sections · depth on demand

What this shows and what it does not

Package-management evidence shows only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself show the resulting service, application or security outcome.

In depth

Package management across the two big families

Nearly every Linux distribution belongs to one of two packaging families. The command names differ, but the tasks are the same.

  • Debian family: Debian and Ubuntu use .deb packages, dpkg for the low level, and APT on top. The apt(8) manual page describes apt as a tool for interactive use. Its behaviour may change between versions, so scripts should use apt-get and apt-cache.
  • RHEL family: RHEL, Rocky, AlmaLinux and Fedora use .rpm packages, rpm for the low level, and DNF on top.

The same tasks in both families

TaskDebian / UbuntuRHEL / Rocky / Alma / Fedora
Refresh repository metadataapt updatednf makecache (or automatic)
List available updatesapt list --upgradablednf check-update
Install updatesapt upgrade / apt full-upgradednf upgrade
Install a packageapt install nginxdnf install nginx
Remove a packageapt remove / apt purgednf remove
Remove unneeded dependenciesapt autoremovednf autoremove
Searchapt search <regex>dnf search <word>
Package detailsapt show <pkg>dnf info <pkg>
Which package owns a filedpkg -S /pathrpm -qf /path
Files in a packagedpkg -L <pkg>rpm -ql <pkg>
Which package provides a file (even if not installed)apt-file search /pathdnf provides /path
Transaction history/var/log/apt/history.logdnf history

Patching routine for servers

StepPurpose
1. Review the pending updatesKnow what will change (kernel, libc, database)
2. Snapshot or back upA rollback path
3. Apply the updatesPackage manager
4. Restart affected services, or reboot for kernel and libc updatesOld code keeps running until then
5. Verify services and logsConfirm the result
host$ sudo apt update && apt list --upgradable 2>/dev/null | head -4
host$ sudo apt full-upgrade
host$ [ -f /var/run/reboot-required ] && cat /var/run/reboot-required.pkgs
host$ sudo needrestart -r l
host$ sudo dnf check-update; echo "exit=$?"
exit=100
host$ sudo dnf upgrade --refresh
host$ sudo dnf needs-restarting -r

Finding what still runs old code

After updates, services keep running the old versions until they're restarted. needrestart (Debian and Ubuntu) and dnf needs-restarting (RHEL family) list them, and report whether a full reboot is needed, for example after a kernel update.

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

Package Management is part of Package Management. Linux package management coordinates trusted software metadata, dependency resolution, package acquisition, local package database changes, file deployment, maintainer or transaction scripts and post-install runtime effects; manager success must be separated from repository trust, package state and workload acceptance.

Runtime state ownership and mechanics. Package management resolves requested names through configured repositories and metadata into signed package artifacts, dependency transactions, filesystem changes and maintainer/scriptlet actions. The package database records installed ownership/version state, but running processes can continue using old mapped binaries or libraries after an upgrade. Repository priority, module/stream policy, pinning and architecture affect what candidate version is selected.

Topic-specific state model. Linux package management coordinates trusted software metadata, dependency resolution, package acquisition, local package database changes, file deployment, maintainer or transaction scripts and post-install runtime effects; manager success must be separated from repository trust, package state and workload acceptance.

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. - Repository reachable ≠ repository metadata trusted or current.

  • Dependency solution accepted ≠ packages installed successfully.
  • Package installed/configured ≠ service started, enabled or healthy.
  • Package-manager exit success ≠ original workload or security posture verified.

Limits and how it fails

Primary failure point. Package-management evidence shows only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself show the resulting service, application or security outcome.

Boundary chain: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload.

Model. “Installed” does not mean running, and “latest” is relative to enabled repositories, priorities and architecture. A successful package transaction does not show daemon configuration is valid or service restart succeeded. Package ownership does not include every generated or administrator-managed file. Repository TLS/signature success shows artifact/source integrity properties, not application fitness. Keep package state, filesystem state and runtime state distinct.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Configuration intent and lifecycle. Treat repository definitions, signing keys, proxy configuration, pin/priorities and package holds/excludes as policy. Refresh metadata deliberately and review the transaction before applying broad upgrades. Distinguish package installation from service enablement/restart and from kernel activation. Avoid mixing unmanaged source installs with package-owned paths unless ownership is explicit, because later upgrades/uninstalls can overwrite or orphan files.

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. 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.

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
linux package managementpackages & repositorieslinux packages & repositoriespackage manager linuxPackages & Repositories troubleshootingsoftware packages repositorieslinux package lifecycle
Embedded reference data

Quick lookup tables

Package Management operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateLinux package management coordinates trusted software metadata, dependency resolution, package acquisition, local package database changes, file deployment, maintainer or transaction scripts and post-install runtime effects; manager success must be separated from repository trust, package state and workload acceptance.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 chaindistribution/release + architecture → repository configuration/trust → metadata refresh → dependency solver/transaction plan → package download + integrity/signature checks → local package database transaction → files/scripts/configuration → runtime/service effects → workload verificationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryPackage-management evidence proves only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself prove the resulting service, application or security outcome.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux package-management evidence can establish this proof path: distribution/release + architecture → repository configuration/trust → metadata refresh → dependency solver/transaction plan → package download + integrity/signature checks → local package database transaction → files/scripts/configuration → runtime/service 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. Package-management evidence proves only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself prove the resulting service, application or security outcome.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.

Package Management · operational reference

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

Reference boundaryPackage Management
Topic pathPackage Management
Runtime stateLinux package management coordinates trusted software metadata, dependency resolution, package acquisition, local package database changes, file deployment, maintainer or transaction scripts and post-install runtime effects; manager success must be separated from repository trust, package state and workload acceptance.
Fast checks- Identify distribution/release, architecture, package manager and exact package/version request. - Capture enabled repositories, metadata age/trust state and the proposed transaction before changing anything. - Verify local package database state and deployed version/files after the transaction. - Repeat the original workload/health test and review service/reboot/configuration side effects.
Verification chaindistribution/release + architecture → repository configuration/trust → metadata refresh → dependency solver/transaction plan → package download + integrity/signature checks → local package database transaction → files/scripts/configuration → runtime/service effects → workload verification Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryPackage-management evidence proves only the repository/solver/transaction/package-state boundaries that were observed; it does not by itself prove the resulting service, application or security outcome. 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?