Photo by Eric Er on Unsplash

On this page

This chapter follows Processes and inter-process communication.

Debian organizes software as .deb packages with metadata, file lists, and maintainer scripts. dpkg installs and removes individual packages; APT resolves dependencies from repositories, verifies signatures, and performs upgrades across the system. Server walkthroughs for Apache on Debian assume this layout—a2enmod, site configs under /etc/apache2, and packages from Debian mirrors (see the Server Development area when that walkthrough is published).

dpkg and low-level package state

dpkg is the back end: unpack, configure, remove. Administrators use it for diagnostics more than daily installs:

Terminal window
dpkg -l 'nginx*'
dpkg -s nginx
dpkg -L nginx
dpkg -S /usr/sbin/nginx

Broken dependencies after a partial install show in dpkg --configure -a and apt --fix-broken install. Package state letters in dpkg -l (ii, iF, rc) tell you if configure failed or files remain after removal.

APT, repositories, and components

APT reads sources, downloads packages, and runs dpkg in order. On Debian 12+, /etc/apt/sources.list.d/debian.sources uses deb822 format:

/etc/apt/sources.list.d/debian.sources
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Components:

Component Meaning
main DFSG-free software
contrib Free software depending on non-free elsewhere
non-free-firmware Firmware blobs split for clarity

Enable non-free-firmware when installers or dmesg ask for missing firmware—see Hardware and devices in Linux.

Everyday commands:

Terminal window
sudo apt update
sudo apt upgrade
sudo apt install curl
apt search 'linux-image'

Security updates and unattended-upgrades

Debian stable receives DSA/DLA security advisories mirrored as package updates. unattended-upgrades can apply security suites automatically on servers.

Track /var/log/apt/history.log and /var/log/dpkg.log during incidents. Pin production servers to stable suite names, not testing, unless you accept API and library churn.

Backports and pinning

Backports bring newer versions to stable without jumping suite. Enable trixie-backports (or your stable backports suite) selectively:

Terminal window
sudo apt install -t trixie-backports some-package

Pinning via /etc/apt/preferences.d/ controls default candidate versions—useful to prefer stable but allow one backported kernel or toolchain.

Flatpak and Snap beside APT

Flatpak and Snap bundle applications with runtimes, independent of Debian’s release cycle. They help desktop apps (browsers, IDEs) but duplicate libraries and use separate trust models (Flathub, Snap Store).

On servers, stay with APT for a single patch surface. On desktops, mixing APT, Flatpak, and Snap is normal—know which updater owns each app.

Choosing packages does not replace understanding who runs as which user—Users, groups and permissions in Linux is next.

The next chapter is Users, groups and permissions in Linux.

Check your understanding

Question 1 of 5

0 of 5 checked

  1. 1. Which command shows files installed by a package in the article?

Search articles

Type a word to search published articles.

Open the search page