The package manager is the heart of software distribution in Linux. This episode dissects the concept of centralized repositories, practices apt, dnf, and pacman, compares the universal snap/flatpak/AppImage formats, and reveals common traps such as the difference between apt update vs apt upgrade in production.

After episode 10 where we covered administrator access and sudo management — from the dangers of logging in as root, the difference between su - vs sudo, /etc/sudoers configuration with visudo, to granting NOPASSWD for automation — you now have a secure administrative key. In this episode, we'll use that key for the most fundamental thing a Linux admin does: managing software.
One of the first reasons people shy away from Linux is the confusion when trying to install an app: on Windows you just click a .exe, on macOS you drag a .dmg, but on Linux you have to type commands like apt install nginx. In fact, this is precisely Linux's greatest strength. This episode will explain why package managers exist, how the three big distro families — Debian/Ubuntu, RHEL, and Arch — run them, and the universal formats that fill the gaps between them. Let's begin.
Think of .exe/.dmg as finding a box of spare parts on the roadside: you never know exactly what's inside, where it came from, whether its version matches your system, and there's no record of who took what. Every .exe from the internet carries its own library versions, puts files wherever it wants, and doesn't coordinate with other applications. The result: two apps can bring conflicting library versions, and there's no centralized way to know "what applications are installed on this machine?".
Package managers remove all that guesswork with four key concepts:
apt install nginx automatically pulls in all the libraries Nginx needs. No more "install this library manually first" drama.This is why the statement "Linux doesn't have .exe" is a misconception: Linux deliberately doesn't have it, because .exe is a chaotic solution. The package manager model is closer to the iOS App Store or Play Store — one trusted source, centralized updates, and the machine knows the status of every application.
Note
The .exe model hasn't completely disappeared from Linux: the AppImage format (we'll cover it later) is a Windows-style "bring the file, run it" effort. But Linux's core philosophy remains repository + package manager — because that's the only way to keep thousands of applications on one system consistent and auditable.
APT (Advanced Package Tool) works on top of .deb packages and reads the repository list from /etc/apt/sources.list and /etc/apt/sources.list.d/. There are two commands you must distinguish from the start: apt update refreshes the list of packages available in the repositories (metadata), while apt upgrade updates the installed packages themselves. apt update doesn't install anything; it only refreshes the catalog.
# Refresh the package catalog from repositories
sudo apt update
# Upgrade all installed packages
sudo apt upgrade
# Install a new package (with its dependencies)
sudo apt install nginx
# Remove a package (without config files)
sudo apt remove nginx
# Remove dependencies that are no longer used
sudo apt autoremoveTo search and inspect packages, APT provides apt search and apt show:
apt search nginx
apt show nginxapt show is a highly recommended habit before installing: it shows the version, dependencies, size, and especially the description — so you know exactly what will be installed. In production, running apt search first also avoids installing a package with a similar name by mistake (for example nginx-core vs nginx).
DNF (Dandified YUM) is the successor to yum in the RHEL family — Rocky Linux, AlmaLinux, Fedora. Its philosophy is the same as APT, but with different terminology. There's no dnf update for the catalog; instead, dnf check-update checks for available updates and dnf update or dnf upgrade applies them.
# Check for available updates (without applying)
sudo dnf check-update
# Apply all updates
sudo dnf update
# Install a package
sudo dnf install nginx
# Remove a package
sudo dnf remove nginx
# Search for a package
sudo dnf search nginxOne of DNF's standout advantages is the transaction summary: before executing, DNF shows the packages that will be installed, upgraded, and removed, then asks for confirmation. This gives you a chance to read what will change — a very valuable audit habit in production.
Pacman is Arch Linux's package manager. Its architecture is rolling release: there's no "distro" version that bumps once a year — updates come continuously. Because of this, one mandatory ritual that can't be skipped is pacman -Syu every time you're about to install something. Let's break down its options:
| Option | Meaning | Notes |
|---|---|---|
-S | Synchronize — install operation from a repo | -S nginx |
-y | Refresh the package database | Like apt update |
-u | Upgrade all packages | Like apt upgrade |
-Syu | Refresh + upgrade (before install) | Mandatory ritual on Arch |
-Rs | Remove a package + its dependencies | -R removes only, -s includes dependencies |
# Refresh + upgrade all packages first
sudo pacman -Syu
# Install a package
sudo pacman -S nginx
# Remove a package with its unused dependencies
sudo pacman -Rs nginxWarning
On Arch, running pacman -S without -Syu first is the main cause of "partial upgrade" — a mix of old and new package versions that can make the system inconsistent, even unbootable. Treat -Syu like warming up before sports: a tiring but mandatory ritual, and skipping it even once can be fatal. In a rolling release, all packages move together; falling one step behind means putting a wrong-sized bolt into a screw that's already changed.
To make the pattern above even clearer, here's a comparison of equivalent commands in the three families. Notice how three different package managers actually do exactly the same thing:
sudo apt update # refresh the catalog
sudo apt upgrade # upgrade all
sudo apt install nginx # install a package
sudo apt remove nginx # remove a package
apt search nginx # search for a packageThe same pattern in different languages — this is what lets an admin move between distros quickly: once you understand the concepts (refresh catalog → install → upgrade → remove → search), the commands are just new vocabulary. What distinguishes them is no longer "how to install", but policy: how often to upgrade, how third-party repositories are handled, and how strict validation is before changes are applied.
All three families above share a weakness: a package built for Ubuntu can fail on Arch. The solution to this "one binary for all distros" problem was born in three universal formats. They solve the dependency hell problem differently: bundling the application along with all its dependencies into a single sandbox isolated from the system.
| Format | Mechanism | Advantages | Disadvantages |
|---|---|---|---|
| Snap | snapd daemon + Ubuntu repo | Scheduled auto-update, approved by Canonical, strict sandbox | Sometimes slow startup, repo centralized at Canonical |
| Flatpak | Shared runtime (Flathub) | Fully open source, no single vendor, granular sandbox | Large runtime initially, needs repo setup |
| AppImage | One portable executable file | No install & no sandbox, just chmod +x | Not auto-updated, no source of truth |
# Snap
sudo snap install code --classic
# Flatpak (after adding the Flathub repo)
flatpak install flathub org.audacityteam.Audacity
# AppImage — download one file, give execute permission, run
chmod +x ./SomeApp.AppImage
./SomeApp.AppImageTip
The rule of thumb: packages from the official distro repository are always the first choice because they're tested for that distro and updated together with the system. Use universal formats (especially Flatpak for GUI apps) when the application isn't available in the official repo. AppImage is best for rarely used applications you want to "take home" without leaving a trace.
The most common trap happens precisely between two commands that look similar: apt update and apt upgrade. Most "repository failed to refresh" or "package not found" problems come from forgetting to run apt update after adding a new repository. Remember the flow: add repository → apt update → then apt install. Installing immediately after adding a PPA without apt update will produce the error "Unable to locate package".
On the other hand, sudo apt upgrade on a production machine isn't a trivial decision. You could suddenly get a new kernel version, libraries whose behavior changes, or service configurations being overwritten. In production, the general policy is don't upgrade carelessly: pin specific package versions, test in staging, and schedule upgrades in a maintenance window. apt upgrade isn't apt-get dist-upgrade (which can change dependencies aggressively), but still — changing hundreds of packages on a live machine without tests is the fastest way to create downtime.
The third very common mistake is a broken PPA. PPA (Personal Package Archive) on Ubuntu is a third-party repository that authors sometimes abandon. Its symptom is typical: apt update errors with "404 Not Found" for one specific repo. The solution isn't deleting all PPAs, but disabling the problematic repo:
# Find out which repo failed — the 404 message names its URL
sudo apt update
# List installed PPAs
find /etc/apt/sources.list.d/ -name "*.list" -exec cat {} \;
# Remove the abandoned PPA
sudo add-apt-repository --remove ppa:some-owner/abandoned-repo| Mistake | Symptom | Solution |
|---|---|---|
Installing without apt update first | Unable to locate package | Run apt update before installing |
Careless apt upgrade in production | Downtime, services change behavior | Pin versions, test in staging, schedule |
| PPA abandoned by its owner | 404 Not Found during update | add-apt-repository --remove |
Editing /etc/apt/sources.list without a backup | System can't update | Back up first, verify with apt update |
sudo pacman -S without -Syu on Arch | Partial upgrade, inconsistent system | Always -Syu before -S |
apt remove to "clean up" an app | Config files still remain | apt purge to remove along with config |
In this episode 11 we've mapped the entire package management landscape: understanding why Linux chose centralized repositories instead of .exe/.dmg installers, practicing the complete lifecycle of apt, dnf, and pacman, comparing the three in one table of equivalent commands, and getting to know the universal formats snap, flatpak, and AppImage along with their trade-offs. The most important lesson: a package manager isn't just "a way to install apps" — it's a software sovereignty management system that makes a machine auditable, updatable, and reproducible.
Once applications are properly installed, the next question is: how does Linux know where to look for programs? The answer is in environment variables, especially PATH. In the next episode 12 we'll discuss shell and environment variables — from VAR=x vs export VAR, important variables like HOME, LANG, and PS1, to customizing .bashrc with aliases and functions, plus your first bash script. See you there!