Linux · How-To

How to Update Linux (apt, dnf, and more)

By , Editor · · Beginner-friendly guide
The short answer

Updating Linux means two things — refreshing the list of available packages, then installing the newer versions. Which command you run depends on your distribution:

  • Ubuntu, Debian, Linux Mint, Pop!_OSsudo apt update && sudo apt upgrade
  • Fedora, RHEL, Rocky, AlmaLinuxsudo dnf upgrade
  • Arch Linux, Manjaro, EndeavourOSsudo pacman -Syu
  • Flatpak appsflatpak update  ·  Snap appssudo snap refresh

That is the whole job for day-to-day updates. Below we walk through each package manager properly, cover the graphical updaters, explain when a kernel update means you need to reboot, and show how to keep Flatpak and Snap software current too. If you are coming from Windows, this replaces both Windows Update and the Microsoft Store in one habit — and unlike Windows, on Linux one command updates your apps and your operating system together. See our other Linux guides for more of the basics.

Not sure which distribution you're on?

Run cat /etc/os-release in a terminal. The NAME and ID_LIKE lines tell you the family — for example an ID_LIKE=debian means the apt commands apply, while ID_LIKE=fedora means use dnf.

1. Debian, Ubuntu and relatives (apt)

Debian-based systems — including Ubuntu, Linux Mint, Pop!_OS and Zorin — use apt. Updating is a two-step process: first refresh the package index, then upgrade.

  1. Open a terminal.
  2. Refresh the list of available packages from the repositories:
    sudo apt update
    This downloads nothing but metadata; it just tells apt what newer versions exist.
  3. Install the newer versions of everything already on your system:
    sudo apt upgrade
    Review the summary of what will change, then press Y to confirm.
  4. You can chain both steps into one line — the && only runs the second command if the first succeeds:
    sudo apt update && sudo apt upgrade

upgrade vs. full-upgrade. Plain apt upgrade installs newer versions and can pull in new dependencies, but it will never remove an installed package. When a bigger update needs to remove something to move forward, use:

sudo apt full-upgrade

This is the modern name for the old apt-get dist-upgrade, and it is allowed to remove packages when required to complete the upgrade. It still keeps you on the same release of the distribution.

Tidy up afterwards. Over time old dependencies pile up. Remove the ones nothing needs any more with:

sudo apt autoremove
Careful with sudo, autoremove and release upgrades

Every command here starts with sudo — you are acting as the administrator, so read what a command will do before confirming. Watch the list apt autoremove proposes before you accept it; occasionally it flags something you still want. And do not confuse a normal update with moving to a new Ubuntu release — that is a separate, bigger operation done with sudo do-release-upgrade (or the Software Updater's prompt), and you should back up first.

2. Fedora, RHEL and relatives (dnf)

Fedora, Red Hat Enterprise Linux, Rocky Linux and AlmaLinux use dnf. It refreshes the metadata automatically as part of the upgrade, so a single command does the whole job:

  1. Open a terminal.
  2. Upgrade every installed package to its newest available version:
    sudo dnf upgrade
    Review the transaction and press Y to proceed. Add --refresh to force a fresh metadata download first: sudo dnf upgrade --refresh.

Current Fedora releases ship DNF5, where /usr/bin/dnf points at the new engine, so the same dnf commands still apply. You may also see sudo dnf update in older guides — on modern DNF it is an alias for upgrade and behaves the same way.

Moving to a new Fedora release (for example one major version to the next) is a dedicated command rather than a normal upgrade:

sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=44
sudo dnf system-upgrade reboot

Replace 44 with the release you are upgrading to.

3. Arch Linux and relatives (pacman)

Arch is a rolling release: instead of periodic big version jumps, you receive a continuous stream of updates. Keeping current is one command:

  1. Open a terminal.
  2. Synchronise the package database and upgrade the whole system in a single step:
    sudo pacman -Syu
    The flags mean Sync, reyrefresh the database, and upgrade installed packages.
  3. If you use the Arch User Repository through a helper such as yay or paru, update those packages too:
    yay -Syu
Never do a partial upgrade on Arch

Arch does not support partial upgrades. Do not run pacman -Sy on its own, and do not install a single package after only refreshing the database — the new package may expect libraries that have not been upgraded yet, which can break your system. Always upgrade everything together with sudo pacman -Syu. After updating, glance at the Arch news for any manual steps a particular update requires.

4. The graphical way — Software / Update tools

You do not have to touch a terminal at all. Every mainstream desktop ships a graphical updater that runs the same operations under the hood:

  • Ubuntu / GNOME — the Software Updater app, or the Updates tab in GNOME Software.
  • Linux Mint — the Update Manager shield icon in the system tray.
  • FedoraGNOME Software (or Discover on KDE) shows system and Flatpak updates together.
  • KDE Plasma (any distro)Discover → Updates.

These tools notify you when updates are available and apply them with a click. They are the easiest option and perfectly safe for everyday use; the command line simply gives you more control and works the same on every machine.

5. Kernel updates and when to reboot

Most updates take effect the moment the program is restarted — no reboot needed. The exception is when the update replaces something that is already running in memory, above all the Linux kernel itself, or core components like systemd or the C library. The old version keeps running until you restart.

  1. On Debian and Ubuntu, a reboot-required flag file appears after such an update. Check for it:
    [ -f /var/run/reboot-required ] && echo "Reboot needed"
  2. On Fedora and RHEL, ask dnf directly:
    sudo dnf needs-restarting -r
  3. When a reboot is needed, save your work and run:
    sudo reboot

After rebooting you will be running the new kernel. Distributions keep a previous kernel or two installed so you can boot back if a new one misbehaves — you will find them in the GRUB boot menu.

6. Flatpak and Snap apps

Flatpak and Snap are cross-distribution app formats that live outside your package manager, so apt, dnf and pacman do not touch them. Update them separately:

  1. Flatpak — update every installed Flatpak app and its runtimes:
    flatpak update
  2. Snap — Snaps refresh themselves automatically in the background, but you can force it:
    sudo snap refresh
One habit, everything current

On a typical Ubuntu desktop you can update the system and both app formats in one line:

sudo apt update && sudo apt upgrade && sudo snap refresh && flatpak update

Swap apt update && apt upgrade for dnf upgrade or pacman -Syu on Fedora or Arch. Run it once a week and your machine stays patched and secure.

How often should you update?

For security, sooner is better — most fixes for known vulnerabilities arrive through these updates. A weekly manual update is plenty for a personal desktop; servers are often updated more frequently or set to apply security patches automatically. On Debian and Ubuntu the unattended-upgrades package can install security updates for you in the background, which is a sensible default for machines you do not want to babysit. Whichever cadence you pick, updating Linux is fast, and — unlike the reboot-heavy Windows Update cycle — rarely interrupts what you are doing.

Frequently asked

Do I need to reboot Linux after updating?

Not for most updates. Ordinary application and library updates take effect once the program is restarted. You only need a reboot when the update replaces the running kernel or core system components such as systemd or the C library, because the version already loaded in memory keeps running until you restart. On Debian and Ubuntu the file /var/run/reboot-required appears when a reboot is needed; on Fedora you can run 'dnf needs-restarting -r' to check.

What is the difference between apt upgrade and apt full-upgrade?

apt upgrade installs newer versions of packages you already have and can add new dependencies, but it will never remove an installed package. apt full-upgrade (equivalent to the older dist-upgrade) does the same but is also allowed to remove packages when that is required to complete the upgrade, so it handles bigger dependency changes. Neither one moves you to a new release of the distribution; use do-release-upgrade for that on Ubuntu.

Why can't I just run pacman -Sy on Arch to refresh one package?

Arch is a rolling release and does not support partial upgrades. Running pacman -Sy refreshes the package database without upgrading the rest of the system, so newly installed packages may expect libraries that are not present yet, which can break your system. Always upgrade the whole system with sudo pacman -Syu instead of refreshing the database on its own.

Does updating with apt or dnf also update Flatpak and Snap apps?

No. apt, dnf, and pacman only manage packages from your distribution's repositories. Flatpak and Snap are separate systems with their own stores. Snap packages refresh automatically in the background, and you can force them with sudo snap refresh. Flatpak apps are updated with flatpak update, which you should run yourself or through your desktop's software centre.

More Linux guides

This guide is part of the Windows Now Linux section. Browse all Linux guides for more distro-agnostic how-tos, or head back to the Windows Now home page.