← back to home

// 03 — survival kit

PACKAGE
MANAGER

Think of it like npm or pip — but for your entire operating system. One command to install, update, or remove any software. No installer wizards, no dragging to Applications, no .exe files.

apt · dnf · snap ~15 min beginner

WHAT IS A PACKAGE MANAGER?

A package manager is a tool that handles software for you. You tell it what you want, it downloads it from a trusted source, installs it, and handles all the dependencies automatically.

The package manager you use depends on which Linux distribution you have:

Distro Package Manager Command
Ubuntu / Debian / Mint APT apt
Fedora / RHEL / CentOS DNF dnf
Arch / Manjaro Pacman pacman
Any distro Snap snap
Not sure which distro you have? Run cat /etc/os-release and look for the NAME line. Most beginners are on Ubuntu — if so, use apt.
Just starting out? Don't pick Arch or Fedora. They're great distros, but they'll slow you down at the beginning with extra setup and less beginner-friendly defaults. Start with Ubuntu or Linux Mint — get comfortable, then switch if you want to.

APT — FOR UBUNTU & DEBIAN

apt is the most common package manager you'll encounter. It pulls software from online repositories (think: official app stores for Linux).

apt update refresh package list

Downloads the latest list of available packages. It doesn't actually update anything yet — it just syncs the index. Always run this before installing something.

user@machine:~$ sudo apt update Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Reading package lists... Done
apt install install a package

Downloads and installs a package. You can install multiple packages in one command. Always needs sudo.

# install one package user@machine:~$ sudo apt install curl # install multiple packages at once user@machine:~$ sudo apt install git curl wget # skip the "do you want to continue?" prompt user@machine:~$ sudo apt install -y nginx
apt remove uninstall a package

Removes a package. Use apt purge instead if you also want to wipe its config files.

# remove the program but keep config files user@machine:~$ sudo apt remove nginx # remove the program AND its config files user@machine:~$ sudo apt purge nginx
apt upgrade update installed packages

Updates all installed packages to their latest versions. Run apt update first to refresh the index, then apt upgrade to apply the updates.

# the standard "update everything" sequence user@machine:~$ sudo apt update && sudo apt upgrade
apt search find a package

Searches available packages by name or description. Useful when you're not sure of the exact package name.

user@machine:~$ apt search postgresql Sorting... Done Full Text Search... Done postgresql/jammy 14+238 all object-relational SQL database (supported version) postgresql-14/jammy 14.7-0ubuntu0.22.04.1 amd64 The World's Most Advanced Open Source Relational Database
Try it: run sudo apt update, then sudo apt install curl. Then verify it worked with curl --version. That's the full cycle.

DNF — FOR FEDORA & RHEL

If you're on Fedora, RHEL, or CentOS, you use dnf. The idea is exactly the same as apt — the commands just look slightly different.

# refresh package index user@machine:~$ sudo dnf check-update # install a package user@machine:~$ sudo dnf install nginx # remove a package user@machine:~$ sudo dnf remove nginx # update all packages user@machine:~$ sudo dnf upgrade # search for a package user@machine:~$ dnf search postgresql

SNAP — WORKS ON ANY DISTRO

Snap is a package format made by Canonical (the company behind Ubuntu). Snap packages are self-contained — they bundle all their dependencies, so they work on almost any Linux distro.

You'll mostly reach for snap when something isn't available in apt, or when you want the latest version of an app.

# install a snap package user@machine:~$ sudo snap install code --classic # list installed snap packages user@machine:~$ snap list # remove a snap package user@machine:~$ sudo snap remove code # update all snap packages user@machine:~$ sudo snap refresh
The --classic flag removes some sandboxing restrictions. Some apps (like VS Code) need it to work properly. You'll know when you need it — snap will tell you.

APT vs DNF vs SNAP

Quick guide for when to use what:

Situation Use
You're on Ubuntu / Debian apt — always try this first
You're on Fedora / RHEL dnf — always try this first
Package not in apt/dnf snap — good fallback
Want latest version of a GUI app snap — often more up-to-date
Setting up a server Stick to apt or dnf — snap isn't ideal for servers
Real-world pattern: as a developer, most of the time you'll run sudo apt update && sudo apt install <thing>. You'll only reach for snap when apt doesn't have what you need.

QUICK REFERENCE

# APT (Ubuntu / Debian) $ sudo apt update # refresh package index $ sudo apt install <package> # install $ sudo apt remove <package> # uninstall $ sudo apt upgrade # update all installed packages $ apt search <keyword> # find a package # DNF (Fedora / RHEL) $ sudo dnf install <package> # install $ sudo dnf remove <package> # uninstall $ sudo dnf upgrade # update all # SNAP (any distro) $ sudo snap install <package> # install $ sudo snap remove <package> # uninstall $ sudo snap refresh # update all snap packages $ snap list # list installed snaps

WHAT NOW?

You've got the survival kit. Navigation, filesystem & permissions, package manager — that's genuinely all you need to function in Linux as a developer.

From here, learn as you go. Need to set up a database? Search "install postgresql ubuntu", grab the command, understand what it does, run it. With repetition, the commands you use often will stick on their own.

Your first real task: install git with your package manager (if you don't have it already). Then run git --version to confirm. That's a real workflow, not a tutorial exercise.