How to Update and Upgrade Packages on Linux in 2026
Keep your Linux system secure and up to date using apt, dnf, or pacman — with practical commands for Ubuntu, Fedora, and Arch.
Why Updating Matters
Updating your Linux packages fixes security vulnerabilities, delivers bug fixes, and brings new features. Unlike Windows, Linux package managers update nearly everything on your system — the OS, applications, and libraries — in one place.
Ubuntu, Debian, and Linux Mint — apt
apt is the package manager for Debian-based distributions. Always run two commands together:
sudo apt update
sudo apt upgrade -y
apt update refreshes the list of available packages. apt upgrade actually installs the updates. The -y flag skips the confirmation prompt.
For a full system upgrade that can add or remove packages to resolve dependencies:
sudo apt full-upgrade -y
Clean up old packages no longer needed:
sudo apt autoremove -y
Fedora and RHEL — dnf
Fedora uses dnf, which handles updates and upgrades in a single command:
sudo dnf upgrade --refresh -y
The --refresh flag forces a metadata sync first. To also check for firmware updates via fwupd:
sudo fwupdmgr refresh
sudo fwupdmgr update
Arch Linux and Manjaro — pacman
Arch uses pacman with a single command for a full system upgrade:
sudo pacman -Syu
-S syncs, y refreshes the database, u upgrades all packages. Never partially upgrade Arch; always run the full -Syu.
How Often Should You Update?
- Servers: weekly, or as soon as security patches drop
- Desktops/WSL: monthly is usually fine
- After a fresh install: immediately, before installing anything else
Quick Reference
- Ubuntu/Debian:
sudo apt update && sudo apt upgrade -y - Fedora:
sudo dnf upgrade --refresh -y - Arch:
sudo pacman -Syu
Keeping your system updated is the single most impactful thing you can do for Linux security.