topics/05-package-managers

Package Managers

Forget hunting for .exe files on random websites. On Linux, installing software is one command away — safer, faster and always up to date.

Packages & package managers

What is a package?

A package is software wrapped in a neat box: the program itself, info about it (name, version), and a list of dependencies — the other packages it needs to work. Common formats: .deb (Debian family) and .rpm (Fedora/Fedora-like).

What is a package manager?

The package manager is your librarian: it downloads packages from trusted online repositories (repos), resolves dependencies automatically, installs, updates and removes them — all cleanly tracked.

Analogy: it's an app store, but older than app stores — and everything in it is free. One command installs an app AND keeps it updated together with your entire system.
Why it's better than downloading installers: software comes from your distro's verified repos (no fake websites), dependencies are shared (no 300 MB bundles), and everything updates with one command.

pm/the-big-three

The big three, side by side

Your distro family decides which one you use. The workflow is always the same: refresh → install / remove → upgrade.

apt Debian · Ubuntu · Mint

The most common manager of all. Two-step ritual: update refreshes the list of available versions, upgrade actually installs them.

bash — apt (Ubuntu/Debian/Mint)
alex@pc:~$sudo apt update                 # refresh package listalex@pc:~$sudo apt install vlc              # installalex@pc:~$sudo apt remove vlc               # removealex@pc:~$sudo apt upgrade                  # update everythingalex@pc:~$apt search media player           # search

pacman Arch · Manjaro

Fast and famously cryptic flags. The one to memorize: -Syu syncs repos and upgrades everything — Arch users run it constantly to stay on the rolling edge.

bash — pacman (Arch/Manjaro)
alex@pc:~$sudo pacman -S vlc      # install (S = sync)alex@pc:~$sudo pacman -Rns vlc    # remove + its depsalex@pc:~$sudo pacman -Syu        # refresh + upgrade allalex@pc:~$pacman -Ss player       # search

dnf Fedora · RHEL family

The friendliest syntax of the three — commands read like plain English. No separate refresh step needed; dnf checks for fresh metadata automatically.

bash — dnf (Fedora)
alex@pc:~$sudo dnf install vlc      # installalex@pc:~$sudo dnf remove vlc       # removealex@pc:~$sudo dnf upgrade          # update everythingalex@pc:~$dnf search player         # search

pm/universal

Universal formats: Flatpak & Snap

These work on (almost) any distro. Apps are sandboxed (isolated from your system) and bundled with everything they need — so the exact same package runs on Ubuntu, Fedora or Arch alike.

Flatpak

Community favorite; the Flathub website hosts thousands of desktop apps (Spotify, Discord, OBS…). Great for graphical apps. Preinstalled on Mint, Fedora and SteamOS.

bash — flatpak
alex@pc:~$flatpak install flathub org.videolan.VLCalex@pc:~$flatpak updatealex@pc:~$flatpak uninstall org.videolan.VLC

Snap

Made by Canonical (the company behind Ubuntu); preinstalled on Ubuntu via the App Center. Updates automatically in the background. Some find it slower to start; others love the zero-maintenance.

bash — snap
alex@pc:~$sudo snap install vlcalex@pc:~$sudo snap refresh      # update allalex@pc:~$sudo snap remove vlc
Which to use? Prefer your distro's native packages first (apt/pacman/dnf) — they're best integrated. Reach for Flatpak or Snap when an app isn't in your repos or you want a newer version.

pm/cheat-table

Comparison: one table to remember

ManagerDistro familyFormatInstallRemoveUpdate all
apt Debian, Ubuntu, Mint .deb sudo apt install pkg sudo apt remove pkg sudo apt update && sudo apt upgrade
pacman Arch, Manjaro .pkg.tar sudo pacman -S pkg sudo pacman -Rns pkg sudo pacman -Syu
dnf Fedora, RHEL .rpm sudo dnf install pkg sudo dnf remove pkg sudo dnf upgrade
flatpak Any (universal) Flatpak flatpak install app flatpak uninstall app flatpak update
snap Any (Ubuntu default) Snap sudo snap install app sudo snap remove app sudo snap refresh
Finished this topic?

Saved locally in your browser — no account needed.