A package manager installs, upgrades, and removes pieces of software on a Linux system in a consistent, trackable way. Rather than downloading source code and running make install, the user tells the package manager "I want nginx" and it fetches a prebuilt package, verifies its signature, resolves dependencies, unpacks files into the right locations, and updates its local database of what is installed.
The major package-manager families on Linux are: dpkg/apt (Debian, Ubuntu) using .deb packages; rpm/dnf/yum/zypper (Red Hat, Fedora, SUSE) using .rpm packages; pacman (Arch) using .pkg.tar.zst; apk (Alpine); portage/emerge (Gentoo, source-based); and nix (NixOS, functional and reproducible).
Package managers solve three hard problems: dependency resolution (installing Y requires X), conflict detection (A and B cannot both be installed), and upgrade safety (new version of a package must not break the system). They are why Linux distributions can coexist thousands of packages with minimal manual effort.
Cross-distribution package formats—Snap, Flatpak, AppImage—provide containerised applications with their own bundled dependencies, useful for desktop software that needs to run on many distributions.
Discussed in:
- Chapter 11: Package Management — A Package Manager Cheat Sheet
Also defined in: Textbook of Linux