Lesson 03

Package
Management

How software gets to your machine, stays up to date, and gets removed cleanly. The package manager is one of the things Linux genuinely does better than every other mainstream OS — once you understand how it works.

3 tiers
~10 min read

Tier 1

Distribution Packages

Every major distro ships its own package manager and maintains its own package repository. These are curated, tested, and security-audited by the distro maintainers. This is where you should install software first.

Choose your distro family

apt
APT
The primary user-facing tool. Resolves dependencies, fetches packages from repositories, and handles upgrades. Wraps dpkg which handles the actual install.
user-facing dependency resolution
dpkg
dpkg
The low-level package tool. Installs .deb files directly. Doesn't resolve dependencies — use apt for everyday work, dpkg when you have a specific .deb file to install.
low-level .deb format
common commands
apt update && apt upgrade
apt install <package>
apt remove <package>
apt search <keyword>
apt show <package>
dpkg -i <file.deb>
pacman
pacman
Fast, no-nonsense package manager. The official repos are called "core", "extra", and "multilib". Minimal interface, excellent documentation. Once you know the flags, it's the fastest tool here.
official repos fast
yay / paru
AUR Helpers
Wrapper tools that extend pacman to also search the AUR. Not official, but essential for most Arch users. paru is written in Rust and is the modern choice. More on the AUR in the next section.
AUR access unofficial
common commands
pacman -Syu (update everything)
pacman -S <pkg> (install)
pacman -R <pkg> (remove)
pacman -Ss <keyword> (search)
pacman -Qi <pkg> (info on installed)
dnf
DNF
Dandified YUM — the modern package manager for Fedora and RHEL family distros. Uses .rpm packages. Handles dependencies and transactions cleanly, with good rollback support.
user-facing .rpm format
rpm
RPM
The low-level tool, analogous to dpkg. Installs .rpm files directly. Use dnf for day-to-day work and rpm when dealing with specific files from vendor downloads.
low-level .rpm format
common commands
dnf upgrade
dnf install <package>
dnf remove <package>
dnf search <keyword>
dnf info <package>
zypper
zypper
openSUSE's package manager. Uses .rpm under the hood but has a different interface from dnf. Excellent transaction handling. openSUSE Tumbleweed is one of the better rolling-release options if you want stability with currency.
user-facing .rpm format
common commands
zypper refresh && zypper update
zypper install <package>
zypper remove <package>
zypper search <keyword>

Tier 2

Cross-Distro Formats

These formats ship a self-contained application bundle with its own runtime dependencies. They work on any distro. The trade-off is size and integration quality — they're a pragmatic solution for software that distros can't or won't package.

flatpak
Flatpak
The current best option for cross-distro GUI apps. Sandboxed — each app runs in an isolated environment with declared permissions. Flathub is the central repository and has nearly everything. Updates happen independently of the distro. Preferred for apps like Spotify, Discord, and games.
sandboxed Flathub best choice
snap
Snap
Canonical's alternative. Also sandboxed, but packages are served from a central Canonical server — there's no community-hosted Snap store equivalent. Controversial: slower startup times, opinionated about snap daemon behavior, some distros refuse to ship it. Ubuntu installs Snaps by default; most other distros prefer Flatpak.
Canonical only controversial
AppImage
AppImage
A single executable file that contains the application and all its dependencies. No install step — download, mark executable, run. No sandbox. Good for trying software quickly or for portable applications on a USB drive. Not managed by a package manager so no automatic updates.
portable no auto-update no sandbox

Rule of thumb: use the distro package manager first. If the app isn't there, or the version is too old, try Flatpak. AppImage as a last resort or for quick evaluation. Snap only if you're on Ubuntu and have no alternative.

Tier 3

Advanced Package Models

These aren't for everyone starting out — but knowing they exist helps you understand why experienced Linux users sometimes have strongly different setups.

PKGBUILD / AUR
The AUR
Arch User Repository. Community-maintained build scripts (PKGBUILDs) that compile and package almost any software for Arch. Over 80,000 packages. Not official — you're trusting community maintainers. Audit scripts before running them. With paru or yay, the workflow feels identical to pacman.
Arch only 80k+ packages audit scripts
nix
Nix / NixOS
Declarative, reproducible package management. Your entire system configuration is described in a Nix expression. Rebuild your exact environment anywhere. Powerful but has a steep learning curve and its own language. NixOS takes this idea to the OS level — the entire system is a configuration file.
declarative reproducible steep learning curve
emerge
Portage / Gentoo
Gentoo's source-based package manager. Every package is compiled from source with USE flags that control exactly which features get compiled in. Maximum control, minimum conveniences. Famous for making you compile Firefox for 10 hours. Genuinely educational if you have time and hardware.
source-based USE flags compile times