Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Debian / Ubuntu

Direct answer

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

When to use this

Use it to install, update or troubleshoot software on Debian-family systems.

First 30 seconds

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.

Operational verification

sources list → apt update fetches indexes → apt resolves dependencies → dpkg unpacks and configures

Evidence · next step

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
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
Key commandapt
Scope / prerequisiteUse it to install, update or troubleshoot software on Debian-family systems.
Reference · 4
What next?3 suggested next steps
Child topics (this level)2
Catalog command links4
Evidence1
On this pageJump to a specific section
Linux command reference

Primary Commands

Configuration and operational commands for this Topic.

aptReference
apt

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

Linux · configuration
apt-getReference
apt-get

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

Linux · configuration
apt-cacheReference
apt-cache

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

Linux · configuration
dpkgReference
dpkg

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

Linux · configuration
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

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-get and apt with different behaviour expectations in scripts (use apt-get in scripts).
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
Drill down

Subtopics

Go one level deeper into this subject.

Key points

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

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

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:

  • dpkg installs, removes and queries .deb files 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)

ActionPurpose
dpkg -i file.debInstall a local package file
dpkg -r pkg / dpkg -P pkgRemove / purge
dpkg -l [pattern]List packages and their state
dpkg -L pkgFiles installed by a package
dpkg -S /pathWhich package owns a file
dpkg -s pkgStatus and details
dpkg --configure -aConfigure everything that's unpacked but unconfigured
dpkg -CAudit: find inconsistent packages

Package states (manual)

StateMeaning
installedUnpacked and configured
config-filesRemoved, but configuration files are still present
unpacked / half-configuredAn installation was interrupted
half-installedUnpacking failed part-way
triggers-awaited / triggers-pendingWaiting 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

SymptomFix
"dpkg was interrupted, you must manually run 'dpkg --configure -a'"dpkg --configure -a
Unmet dependencies after dpkg -iapt -f install (fetches the missing dependencies)
A broken maintainer scriptRead 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.

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

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:

ToolUse
aptInteractive install/upgrade/search
apt-get, apt-cacheScripting (stable output)
dpkgLow-level .deb install and queries
unattended-upgradesAutomatic security updates
needrestartServices 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.

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. 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
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 → 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%
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
debian package managementubuntu package managementapt dpkg relationshipdeb packages
Embedded reference data

Quick lookup tables

Debian / Ubuntu operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Debian / Ubuntu.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDebian 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 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 chainDebian/Ubuntu release → sources + pin/hold policy → APT metadata/candidate → dependency solution → .deb acquisition/trust → dpkg unpack → maintainer scripts/configuration → dpkg installed state → service/workload verificationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryDebian/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 evidenceCorrelated 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 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. 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 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.

Debian / Ubuntu · operational reference

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

Reference boundaryDebian / Ubuntu
Topic pathPackage Management → Debian / Ubuntu
Runtime stateDebian 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 chainDebian/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 boundaryDebian/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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?