Use it to install, update or troubleshoot software on Debian-family systems.
Debian / Ubuntu
Debian and Ubuntu use .deb packages managed by dpkg (low level) and APT (repositories, dependencies). Repositories are listed in /etc/apt/sources.list and /etc/apt/sources.list.d/.
1. apt update — errors (404, GPG)?
2. apt policy <pkg> — candidate from the expected repository?
3. Install: apt install <pkg>.
4. Broken state → dpkg --configure -a and apt -f install.
5. Check the log: /var/log/apt/history.log.
sources list → apt update fetches indexes → apt resolves dependencies → dpkg unpacks and configures
For Package Management → Debian / Ubuntu, continue with the first unproven Topic check: Confirm OS release/codename, architecture and enabled Debian/Ubuntu sources. If that boundary is healthy, advance to the adjacent check: Compare installed version, APT candidate/origin and any held/pinned package state. 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
Operational reference
Fast context before you go deeper.
aptPrimary Commands
Configuration and operational commands for this Topic.
aptReferenceInteractively search, inspect, install, remove and update packages on Debian-family systems.
Use when: Primary lookup intent: configure. Use apt when the lookup goal is to interactively search, inspect, install, remove and update packages on Debian-family systems. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Post-change verification for apt: Read back package versions/policy and retest every affected service or workload. Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: configure. Safety class: changes_state. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. apt is documented as an operational lookup primitive under Debian / Ubuntu. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
apt-getReferencePerform script-friendly Debian-family package retrieval, installation, removal and upgrade operations.
Use when: Primary lookup intent: configure. Use apt-get when the lookup goal is to perform script-friendly Debian-family package retrieval, installation, removal and upgrade operations. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Post-change verification for apt-get: Verify dpkg/apt-cache state and run the original dependent-service test. Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: configure. Safety class: changes_state. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. apt-get is documented as an operational lookup primitive under Debian / Ubuntu. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
apt-cacheReferenceQuery APT package metadata, versions, dependencies and policy without changing installed state.
Use when: Primary lookup intent: verify. Use apt-cache when the lookup goal is to query APT package metadata, versions, dependencies and policy without changing installed state. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: verify. Safety class: read_only. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. apt-cache is documented as an operational lookup primitive under Debian / Ubuntu. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
dpkgReferenceInspect or modify the local Debian package database and install or remove .deb packages.
Use when: Primary lookup intent: configure. Use dpkg when the lookup goal is to inspect or modify the local Debian package database and install or remove .deb packages. Tie the result to the same host, namespace, user identity and time window as the symptom.
Quick note: Post-change verification for dpkg: Verify dpkg status/version/conffiles and rerun the dependent service or application test. Output review: healthy and suspicious cues are command-specific interpretation boundaries, not fixed literal output samples. Intent class: configure. Safety class: changes_state. Intent describes the primary lookup role; safety remains command-family capability and can be higher than a read-only invocation. dpkg is documented as an operational lookup primitive under Debian / Ubuntu. The canonical leaf intentionally represents the command family; options remain distribution/tool-version specific.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
Debian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/workload verification
Healthy evidence: APT candidate/origin matches policy, dpkg reaches the expected installed/configured state, maintainer scripts finish and affected workloads remain healthy.
Step 2 Commands Verify boundary
apt update
apt full-upgrade
apt autoremove
Step 3 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Confirm OS release/codename, architecture and enabled Debian/Ubuntu sources.
- Compare installed version, APT candidate/origin and any held/pinned package state.
- Inspect dpkg status plus unpack/configure errors and maintainer-script results.
- Verify affected services, configuration and original application behavior after package changes.
Verification chain. Debian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/workload verification
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: the candidate comes from an unintended pocket/PPA, dpkg is left half-configured, or APT success is assumed to show application health.
Step 5 Common mistakes Narrow the fault
- Running
apt-getandaptwith different behaviour expectations in scripts (useapt-getin scripts).
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.
Subtopics
Go one level deeper into this subject.
APT is Debian-family repository-aware package management: it downloads repository indexes, computes candidates using version/pinning rules, resolves dependencies/conflicts and orchestrates dpkg transactions for install, upgrade and removal operations.
Subtopic RepositoriesDebian/Ubuntu repositories define package origins and metadata through configured source entries, suites/codenames, components, architectures and cryptographic signing trust; source reachability and source authenticity are distinct properties.
Run apt update before installing to refresh package lists. Use apt full-upgrade for upgrades that change dependencies. Third-party repositories need their signing key in /etc/apt/keyrings with signed-by=.
apt policy <pkg> / dnf info <pkg>— installed and candidate versionsdpkg -l <pkg> / rpm -q <pkg>— installed packageapt-cache depends <pkg> / dnf repoquery --requires <pkg>— dependenciesdpkg -S <file> / rpm -qf <file>— package owning a file
ReferenceWhat it is1 section · depth on demand
Core model
Identify the exact Debian/Ubuntu release and architecture first. Use APT for repository-aware solving and dpkg as the authoritative local installed-package database/tooling layer. Track candidate version and origin, dpkg package state, conffile handling and maintainer-script outcomes separately. APT can report a failed high-level transaction because dpkg configuration failed after packages were already unpacked.
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Debian/Ubuntu package evidence can establish APT policy and dpkg transaction state, but not whether every package-provided service or application is operational.
In depth
The Debian package system: dpkg underneath APT
Debian and Ubuntu use a two-level package system. The dpkg(1) manual page describes the low level:
dpkginstalls, removes and queries.debfiles and keeps the package database.- Removing a package (
-r) keeps its configuration files, while purging (-P) removes them too. - The manual calls APT the primary and more user-friendly front-end. APT fetches packages from repositories and resolves dependencies.
dpkg actions (manual)
| Action | Purpose |
|---|---|
dpkg -i file.deb | Install a local package file |
dpkg -r pkg / dpkg -P pkg | Remove / purge |
dpkg -l [pattern] | List packages and their state |
dpkg -L pkg | Files installed by a package |
dpkg -S /path | Which package owns a file |
dpkg -s pkg | Status and details |
dpkg --configure -a | Configure everything that's unpacked but unconfigured |
dpkg -C | Audit: find inconsistent packages |
Package states (manual)
| State | Meaning |
|---|---|
| installed | Unpacked and configured |
| config-files | Removed, but configuration files are still present |
| unpacked / half-configured | An installation was interrupted |
| half-installed | Unpacking failed part-way |
| triggers-awaited / triggers-pending | Waiting for another package's trigger processing |
Reading dpkg -l
The first column holds two letters: the desired state, then the actual state. ii means "install, installed", which is normal. rc means "removed, configuration files remain", and dpkg -P cleans those up. Anything else, such as iU or iF, points to an interrupted operation.
Repairing an interrupted installation
| Symptom | Fix |
|---|---|
| "dpkg was interrupted, you must manually run 'dpkg --configure -a'" | dpkg --configure -a |
Unmet dependencies after dpkg -i | apt -f install (fetches the missing dependencies) |
| A broken maintainer script | Read its output; /var/lib/dpkg/info/<pkg>.postinst |
host$ dpkg -l 'openssh*' | tail -3
ii openssh-client 1:9.6p1-3ubuntu13.5 amd64 secure shell (SSH) client
ii openssh-server 1:9.6p1-3ubuntu13.5 amd64 secure shell (SSH) server
host$ dpkg -l | awk '$1=="rc" {print $2}' | head
host$ dpkg -l | awk '$1=="rc" {print $2}' | xargs -r sudo dpkg -P
host$ sudo dpkg -i ./agent_2.4.1_amd64.deb
dpkg: dependency problems prevent configuration of agent:
agent depends on libjq1; however: Package libjq1 is not installed.
host$ sudo apt -f install
host$ dpkg -S /usr/sbin/sshd
openssh-server: /usr/sbin/sshd
Installing local .deb files
apt install ./file.deb, with the ./, installs a local file and resolves its dependencies from the repositories in one step. That's usually better than dpkg -i followed by apt -f install.
Documented example, not captured output.
Platform, version and operating-envelope scope
Package manager and package naming differ across Debian/Ubuntu, RHEL-family and other distributions.
How it works at runtime
Debian / Ubuntu is part of Package Management → Debian / Ubuntu. Debian and Ubuntu package management layers APT dependency/repository policy over dpkg local package state, with Debian package metadata, maintainer scripts, debconf/config-file semantics and distribution release pockets influencing the effective transaction.
Topic-specific state model. Debian and Ubuntu package management layers APT dependency/repository policy over dpkg local package state, with Debian package metadata, maintainer scripts, debconf/config-file semantics and distribution release pockets influencing the effective transaction.
Interpretation rule. - APT metadata/candidate state ≠ dpkg installed/configured state.
- Downloaded .deb ≠ installed package.
- Unpacked ≠ configured.
- Package configured ≠ service or application healthy.
Quick reference
Debian/Ubuntu package tools:
| Tool | Use |
|---|---|
apt | Interactive install/upgrade/search |
apt-get, apt-cache | Scripting (stable output) |
dpkg | Low-level .deb install and queries |
unattended-upgrades | Automatic security updates |
needrestart | Services to restart after library updates |
apt update && apt list --upgradable
apt install --no-install-recommends nginx
apt full-upgrade
dpkg -l | grep nginx; dpkg -L nginx; dpkg -S /usr/sbin/nginx
apt-mark hold linux-image-generic
Ubuntu Pro/ESM extends LTS security updates from 5 to 10 years, and the Legacy add-on extends them further.
Limits and how it fails
Primary failure point. Debian/Ubuntu package evidence can establish APT policy and dpkg transaction state, but not whether every package-provided service or application is operational.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Debian / Ubuntu owns the Debian-family package stack relationship. APT and Repositories own their deeper policy/metadata concerns; generic service/filesystem outcomes stay in owning Linux branches.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Package Management → Debian / Ubuntu. 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%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.
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.
Quick lookup tables
Debian / Ubuntu operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Debian / Ubuntu.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Debian and Ubuntu package management layers APT dependency/repository policy over dpkg local package state, with Debian package metadata, maintainer scripts, debconf/config-file semantics and distribution release pockets influencing the effective transaction. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin 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 chain | Debian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/workload verification | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Debian/Ubuntu package evidence can establish APT policy and dpkg transaction state, but not whether every package-provided service or application is operational. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux package-management evidence can establish this proof path: Debian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/workload verification | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured repository, solver, transaction, local package database, runtime-side-effect or workload scope. Debian/Ubuntu package evidence can establish APT policy and dpkg transaction state, but not whether every package-provided service or application is operational. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue 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. |
Debian / Ubuntu · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Debian / Ubuntu |
|---|---|
| Topic path | Package Management → Debian / Ubuntu |
| Runtime state | Debian and Ubuntu package management layers APT dependency/repository policy over dpkg local package state, with Debian package metadata, maintainer scripts, debconf/config-file semantics and distribution release pockets influencing the effective transaction. |
| Fast checks | - Confirm OS release/codename, architecture and enabled Debian/Ubuntu sources. - Compare installed version, APT candidate/origin and any held/pinned package state. - Inspect dpkg status plus unpack/configure errors and maintainer-script results. - Verify affected services, configuration and original application behavior after package changes. |
| Verification chain | Debian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/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 boundary | Debian/Ubuntu package evidence can establish APT policy and dpkg transaction state, but not whether every package-provided service or application is operational. Boundary chain: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |