Instiq
Chapter 4 · Repositories and Package Management·v1.0.0·Updated 7/6/2026·~9 min

What's changed: Initial version (topic 1.04, subtopics 1.04.1–1.04.4)

4.2Debian Package Management

Key points

Learn direct handling of deb packages without a repository: install/upgrade/remove with dpkg, listing installed packages (-l), listing a package's files (-L), reverse lookup (-S), and re-configuration with dpkg-reconfigure.

Beneath apt works dpkg. When a vendor hands you a .deb file, or when you inspect installed packages, you use dpkg directly. dpkg does not resolve dependencies—the decisive difference from apt.

4.2.1Core dpkg operations

  • Install/upgrade with dpkg -i package.deb (upgrades if already present); remove with dpkg -r (keeps config) or dpkg -P (purge—config too).
  • Query with dpkg -l (installed list), dpkg -L pkg (files the package owns), dpkg -S file (file → owning package, installed only).
  • dpkg-reconfigure re-runs a package's install-time dialog (dpkg-reconfigure tzdata for time zone is the classic example).
Exam point

Staples: dpkg -i resolves no dependencies (on errors, use apt instead), -L = package→files, -S = file→package, redo configuration = dpkg-reconfigure. Swapping -L and -S is the most common trap.

Continue reading — free sign-up

You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.