Skip to content
# Getting started

Updating your system

Keep packages and security patches current β€” the exact command depends on your distro's package manager.

Why this matters

Distros ship security fixes through their package manager, not a single OS-wide updater like desktop operating systems. Running the update command regularly (or enabling unattended upgrades) is the single highest-value thing you can do for a server's security.

Debian & Ubuntu (APT)

Refresh the package index, then upgrade. autoremove clears packages nothing depends on anymore.

bash
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y

RHEL, Rocky, AlmaLinux & Fedora (DNF)

dnf resolves and applies updates in one step; check-update alone just lists what's available without installing.

bash
sudo dnf check-update
sudo dnf upgrade -y

openSUSE (Zypper)

refresh updates repo metadata, update applies available package updates.

bash
sudo zypper refresh
sudo zypper update -y

Alpine (APK)

update refreshes the index, upgrade installs newer versions of everything already installed.

bash
sudo apk update
sudo apk upgrade

Arch (Pacman)

Arch is a rolling release β€” -Syu syncs repos and upgrades the whole system in one command. Run it often; long gaps between updates make partial upgrades more likely to break something.

bash
sudo pacman -Syu