Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Package Problems

Direct answer

Package problems are failed installs or upgrades: dependency errors, broken or half-configured packages, repository or signature errors, and locks.

When to use this

Use it when apt or dnf fails.

First 30 seconds

1. Exact error text?

2. Repos: apt update / dnf makecache clean?

3. Broken state: dpkg --audit / rpm -Va --nofiles --nodigest.

4. Repair: dpkg --configure -a, apt -f install / dnf distro-sync.

5. History: /var/log/apt/history.log / dnf history.

Operational verification

repos healthy → dependencies resolvable → transaction runs → packages configured

Evidence · next step

For Linux Troubleshooting → Package Problems, continue with the first unproven Topic check: Capture package manager command, repositories/origins, metadata age and exact error before cleanup. If that boundary is healthy, advance to the adjacent check: Inspect candidate/version, dependency/conflict/held state, locks and dpkg/RPM transaction/database consistency. 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 when apt or dnf fails.
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

Healthy evidence: the intended package/version/origin is resolved and installed with consistent package database state, scripts complete, and the dependent service/workload passes acceptance.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Capture package manager command, repositories/origins, metadata age and exact error before cleanup.

  • Inspect candidate/version, dependency/conflict/held state, locks and dpkg/RPM transaction/database consistency.
  • Review maintainer-script and filesystem/service failures separately from solver/download success.
  • Repair the first failed package boundary, complete/verify transaction, then repeat the original application/service acceptance test.
Step 3 Commands Verify boundary
apt -f install
dpkg --audit
dnf history
rpm -Va | head
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: cache cleanup is used as a universal fix, repositories are changed before origin is captured, installed status is accepted without service verification, or interrupted transactions are retried blindly.

Step 5 Common mistakes Narrow the fault
  • Forcing installs with --force/--nodeps.
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

Read the exact error. Fix repositories first (apt update / dnf makecache). Don't force; repair with dpkg --configure -a/apt -f install or dnf distro-sync. Check the package history for what changed.

Key checks
  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages
ReferenceWhat it is1 section · depth on demand

Core model

Identify the exact package operation and distribution/repositories. Separate metadata freshness, origin/pinning/module stream, solver plan, transaction locks, package database state and scripts/config changes; preserve the failed transaction evidence before retrying.

ReferenceImportant terms & boundaries4 sections · depth on demand

What this shows and what it does not

Package Problems owns cross-layer package fault isolation; Package Management owns APT/DNF/RPM semantics and service/application branches own post-install behavior.

In depth

Debian / Ubuntu: diagnose before forcing

$ sudo apt-get check
$ sudo apt-get -s install nginx          # simulate: shows what would change, changes nothing
$ sudo apt-get -f install                # attempt to fix broken dependencies
$ sudo dpkg --audit                      # half-installed / unconfigured packages
$ sudo dpkg --configure -a               # finish interrupted configuration

The apt-get manual describes check as a diagnostic that updates the cache and checks for broken dependencies, -s/--simulate as a run that changes nothing, and -f/--fix-broken as an attempt to correct broken dependencies in place.

ErrorCauseFix
Could not get lock /var/lib/dpkg/lock-frontendAnother apt/dpkg process (often unattended-upgrades)Wait; ps aux \| grep -E 'apt\|dpkg' — never delete lock files while a process runs
dpkg was interruptedPrevious run killeddpkg --configure -a
unmet dependencies / held packagesMixed repositories or pinned versionsapt-cache policy <pkg>, apt-mark showhold
NO_PUBKEY / signature errorsRepository key missing or expiredInstall the vendor keyring into /etc/apt/keyrings and reference it with signed-by=
Hash Sum mismatchProxy/mirror serving stale filesapt-get clean, retry or switch mirror

RHEL family equivalents

TaskCommand
Simulatednf install --assumeno nginx
History and undodnf history, dnf history undo <id>
Problems in the RPM databaserpm -Va (verify files), rpm --rebuilddb (last resort)
Duplicate packages after interruptiondnf remove --duplicates
Which repo provides a filednf provides /usr/bin/xyz

Find what changed

/var/log/apt/history.log and /var/log/dpkg.log (Debian) or dnf history info <id> (RHEL) show exactly which packages changed and when — the first place to look when "it stopped working after updates".

Avoid making it worse

Do not mix distribution releases (adding a newer release's repository "for one package"), do not force-remove with dpkg --force-all on production systems, and snapshot or back up before large upgrades.

*The APT and dpkg commands illustrate package recovery checks; no executed package transaction is supplied.*

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 Problems is part of Linux Troubleshooting → Package Problems. Package Problems isolates repository metadata/trust, candidate selection, dependency/conflict resolution, download/integrity, dpkg/RPM database, maintainer scripts and post-install service/workload effects.

Topic-specific state model. Package Problems isolates repository metadata/trust, candidate selection, dependency/conflict resolution, download/integrity, dpkg/RPM database, maintainer scripts and post-install service/workload effects.

Interpretation rule. - Repository reachable ≠ metadata/trust/candidate is correct.

  • Solver produces a plan ≠ installation scripts will succeed.
  • Package database says installed ≠ files/config/service are operational.
  • Repeated apt/dnf retry ≠ interrupted database or dependency state is repaired.

Method

Package manager problems:

SymptomFix
Could not get lock /var/lib/dpkg/lockAnother apt/unattended-upgrades running — wait, check ps
dpkg was interrupteddpkg --configure -a
Broken dependencies (apt)apt -f install, check mixed repos/pinning
GPG key errorsRepository key rotated — import new key (signed-by keyring)
dnf conflictsdnf history, dnf distro-sync, module streams
RPM database corruptionrpm --rebuilddb
Repo metadata errorsdnf clean all / apt clean, proxy, mirror
apt-cache policy nginx; apt list --upgradable
dnf repolist -v; dnf history info last
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Package Problems owns cross-layer package fault isolation; Package Management owns APT/DNF/RPM semantics and service/application branches own post-install behavior.

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 Linux Troubleshooting → Package Problems. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/ · 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 problemsapt broken packagesdnf transaction failuredpkg error troubleshooting
Embedded reference data

Quick lookup tables

Package Problems operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective statePackage Problems isolates repository metadata/trust, candidate selection, dependency/conflict resolution, download/integrity, dpkg/RPM database, maintainer scripts and post-install service/workload effects.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin symptom + exact time + host/boot/user → define scope + expected baseline → preserve original failing test → collect targeted kernel/process/service/storage/network/security/log evidence → identify first divergent boundary → make one minimal reversible change → repeat original test → verify adjacent regressions and retain before/after evidence.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkTrace requested/configured state through effective state to the observed workload result.
Failure boundaryPackage Problems troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux troubleshooting evidence can establish this proof path: symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host, boot, process/user, dependency, time or workload scope. Package Problems troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: reproduce the exact original failure, collect the owning subsystem evidence at the same time, change only the proven cause or prerequisite, then repeat the original workload and regression checks.Continue to the next unresolved boundary while preserving the original test condition.

Package Problems · operational reference

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

Reference boundaryPackage Problems
Topic pathLinux Troubleshooting → Package Problems
Runtime statePackage Problems isolates repository metadata/trust, candidate selection, dependency/conflict resolution, download/integrity, dpkg/RPM database, maintainer scripts and post-install service/workload effects.
Fast checks- Capture package manager command, repositories/origins, metadata age and exact error before cleanup. - Inspect candidate/version, dependency/conflict/held state, locks and dpkg/RPM transaction/database consistency. - Review maintainer-script and filesystem/service failures separately from solver/download success. - Repair the first failed package boundary, complete/verify transaction, then repeat the original application/service acceptance test.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check 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 boundaryPackage Problems troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final 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?