Pcornel
Linux · Package Management

Debian / Ubuntu

Cheat sheet · https://pcornel.dk/topic.php?topic=2738

Back to the Topic

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

Remember

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

First 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

Commands

apt
Interactively search, inspect, install, remove and update packages on Debian-family systems.
apt-get
Perform script-friendly Debian-family package retrieval, installation, removal and upgrade operations.
apt-cache
Query APT package metadata, versions, dependencies and policy without changing installed state.
dpkg
Inspect or modify the local Debian package database and install or remove .deb packages.

Verify in this order

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

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2738

Confirmation

Confirm action

Continue?