Updating Linux: Ubuntu, Fedora, CentOS, Arch

Updating Linux; To update Linux, use the package manager for your distribution to refresh available package information and install software updates. The exact command depends on which Linux distribution you are running. This guide covers how to update Ubuntu, Debian, Linux Mint, Fedora, Rocky Linux, AlmaLinux, CentOS Stream, and Arch Linux from the terminal (also covers upgrading Linux).

Updating Linux Packages on Ubuntu Debian Fedora CentOS and Arch Linux

Linux Update Commands Quick Reference

Use the command that matches your Linux distribution:

  • Ubuntu / Debian / Linux Mint: sudo apt update && sudo apt upgrade
  • Fedora: sudo dnf upgrade --refresh
  • Rocky Linux / AlmaLinux / CentOS Stream: sudo dnf upgrade --refresh
  • Arch Linux: sudo pacman -Syu

Important: These commands update installed packages within your current Linux release. Upgrading Linux to a newer major distribution release is a separate process.

1. Identify Your Linux Distribution

If you are not sure which Linux distribution or version you are running, open a terminal and use:

cat /etc/os-release

This displays information such as the distribution name, version, and release information. You can also use:

lsb_release -a

The lsb_release command may not be installed by default on every Linux distribution, so cat /etc/os-release is generally the simplest option.

2. Update Ubuntu, Debian, and Linux Mint

Ubuntu, Debian, Linux Mint, and many other Debian based Linux distributions use the APT package manager.

Open a terminal and run:

sudo apt update

This refreshes the local package lists and checks the configured software repositories for information about newer packages.

Next, install the available updates:

sudo apt upgrade

Review the packages that will be upgraded and type Y when prompted to continue.

What Is the Difference Between apt Update and apt Upgrade?

sudo apt update refreshes the package information available from your configured repositories. It does not install the updates.

sudo apt upgrade then downloads and installs available updates for packages already installed on your system.

For convenience, you can run both commands together:

sudo apt update && sudo apt upgrade

The && operator runs the second command only if the first command completes successfully.

Optional: Full Package Upgrade

Most routine updates can be handled with apt upgrade. If package dependencies require packages to be added or removed in order to complete the upgrade, you can use:

sudo apt full-upgrade

apt full-upgrade can make dependency changes that the regular apt upgrade command may leave unresolved. It does not upgrade Ubuntu or Debian to a new distribution release.

Optional: Remove Unused Packages

After updating, you can check for packages that are no longer needed:

sudo apt autoremove

Review the packages listed before confirming their removal.

You can also clear downloaded package files from the local cache with:

sudo apt clean

These cleanup commands are optional and are not required every time you update Linux.

3. Update Fedora Linux

Fedora uses the DNF package manager. To refresh repository metadata and install available updates, run:

sudo dnf upgrade --refresh

This refreshes the repository metadata and upgrades installed packages to available newer versions.

Optional: Remove Unneeded Fedora Packages

Fedora can also remove dependencies that are no longer required:

sudo dnf autoremove

Review the packages before confirming their removal.

4. Update Rocky Linux, AlmaLinux, and CentOS Stream

Current Rocky Linux, AlmaLinux, and CentOS Stream releases use DNF for package management.

To update installed packages, run:

sudo dnf upgrade --refresh

This refreshes repository metadata and installs available package updates.

You can optionally remove packages that are no longer required:

sudo dnf autoremove

Older CentOS Systems

Older CentOS releases used YUM as the primary package management command. On systems that still use YUM, the traditional update command is:

sudo yum update

Modern RHEL-based distributions generally use DNF. Before attempting to update an older CentOS installation, check whether that release is still supported.

5. Update Arch Linux

Arch Linux uses the Pacman package manager and follows a rolling-release model. Rather than upgrading from one numbered Arch release to another, you keep the system current by regularly performing full system upgrades.

To update Arch Linux, run:

sudo pacman -Syu

This synchronizes the package databases and upgrades installed packages as part of the same operation.

Important: Avoid Partial Upgrades on Arch Linux

Arch Linux does not support partial system upgrades. Do not refresh the package database with pacman -Sy and then perform unrelated package operations without completing a full system upgrade.

For a normal system update, use:

sudo pacman -Syu

If an Arch update fails after the package databases have been synchronized, resolve the problem and complete the system upgrade before continuing with other package management operations.

Check for Orphaned Packages

You can check whether your Arch installation has orphaned packages with:

pacman -Qtd

If orphaned packages are listed, review them and decide whether they are still needed before removing them.

Linux Update vs. Upgrade: What's the Difference?

The terms update and upgrade can be confusing because Linux package managers use them in different ways.

A Linux system update normally installs newer versions of packages while keeping your current distribution release. For example, running sudo apt upgrade updates packages within your current Ubuntu release.

A Linux distribution upgrade moves the operating system to a newer release. For example, moving from one Ubuntu LTS release to the next is a distribution upgrade rather than a normal package update.

Major release upgrades use different procedures from routine package updates and should be prepared for carefully.

How to Upgrade Ubuntu to a New Release

Upgrading Ubuntu to a new release is different from installing normal package updates. Before starting a release upgrade, back up important files, review the release notes, make sure the current system is fully updated, and ensure you have enough free disk space.

After preparing the system, start the Ubuntu release upgrade with:

sudo do-release-upgrade

Follow the prompts provided by the upgrade tool.

Ubuntu's release upgrade tool performs checks before making changes and can handle configuration changes required when moving between releases. Ubuntu also recommends fully updating the current installation before starting a release upgrade.

Do not confuse apt upgrade or apt full-upgrade with do-release-upgrade. The former update packages within the current release, while do-release-upgrade is used to move Ubuntu to a newer release.

How to Upgrade Fedora to a New Version

Fedora uses the DNF system upgrade process to move between major Fedora releases.

First, make sure your current Fedora installation is fully updated:

sudo dnf upgrade --refresh

Then download the packages for the target Fedora release:

sudo dnf system-upgrade download --releasever=version_number

Replace version_number with the Fedora release you want to upgrade to.

After the packages have been downloaded successfully, start the upgrade:

sudo dnf system-upgrade reboot

The system will reboot into the upgrade environment and then restart into the upgraded Fedora release.

On newer Fedora installations using DNF5, the system upgrade functionality is built into DNF5. Older DNF4 installations may use the dnf-plugin-system-upgrade plugin.

Major Release Upgrades on RHEL-Based Linux

Updating packages within Rocky Linux, AlmaLinux, CentOS Stream, or another RHEL-based distribution is generally straightforward with DNF. Moving between major distribution releases is different.

Major version upgrade procedures vary by distribution and release. Before attempting a major upgrade, consult the official documentation for your specific operating system and release. Back up important data and verify that your hardware, software repositories, and applications are supported by the target release.

For example, Rocky Linux documents supported version upgrade procedures separately from routine package updates.

Do You Need to Reboot After Updating Linux?

Not every Linux update requires a reboot. Many package updates can be installed and used immediately.

A reboot is commonly recommended after installing a new Linux kernel or other system components that are currently in use. Your distribution may notify you when a reboot is required.

If your system indicates that a reboot is needed, you can restart from the terminal with:

sudo reboot

Best Practices for Updating Linux

  • Update regularly: Regular updates help install security fixes, bug fixes, and software improvements.
  • Use the correct package manager: Use APT for Debian-based distributions, DNF for modern Fedora and RHEL-based systems, and Pacman for Arch Linux.
  • Review changes: Pay attention to packages being installed, upgraded, or removed before confirming an update.
  • Back up important files: Always maintain current backups before major distribution upgrades.
  • Keep enough free disk space: Major release upgrades can require significant temporary storage.
  • Reboot when recommended: A reboot may be required after kernel or other core system updates.
  • Use official documentation for major upgrades: Release upgrade procedures vary between distributions.

Frequently Asked Questions

What is the Linux update command?

The Linux update command depends on the distribution. Ubuntu, Debian, and Linux Mint use sudo apt update && sudo apt upgrade. Fedora, Rocky Linux, AlmaLinux, and CentOS Stream use sudo dnf upgrade --refresh. Arch Linux uses sudo pacman -Syu.

How do I update Linux from the terminal?

Open a terminal and use the package manager for your Linux distribution. Debian based systems use APT, Fedora and many RHEL-based systems use DNF, and Arch Linux uses Pacman.

What is the difference between apt update and apt upgrade?

apt update refreshes the package information from configured repositories. It does not install updates. apt upgrade downloads and installs available updates for installed packages.

Does updating Linux upgrade the operating system?

Normally, no. A regular Linux update installs newer packages within your current distribution release. Moving to a newer Ubuntu, Fedora, or other major distribution release is a separate release upgrade process.

How often should I update Linux?

For most desktop systems, checking for updates regularly is a good practice. Security updates should be installed promptly, while the exact update schedule depends on the distribution and how the computer is used.

Is sudo apt autoremove safe?

apt autoremove removes packages that APT determines are no longer required as dependencies. Review the packages that will be removed before confirming the operation.

Do I need to reboot after updating Linux?

Not necessarily. Many Linux updates take effect without a reboot. A restart is commonly recommended after kernel updates or when the distribution indicates that a reboot is required.

Can I update Linux without reinstalling it?

Yes. Routine package updates are normally performed directly on the existing Linux installation using the distribution's package manager. A separate release-upgrade procedure is used when moving to a newer distribution release.

Can I update Linux with one command?

There is no single universal Linux update command because distributions use different package managers. For example, Ubuntu and Debian use APT, Fedora uses DNF, and Arch Linux uses Pacman.

Final Thoughts on Updating Linux

Updating Linux is usually straightforward once you know which package manager your distribution uses. Ubuntu, Debian, and Linux Mint use APT, Fedora and many RHEL-based distributions use DNF, and Arch Linux uses Pacman.

For routine maintenance, use the appropriate package manager to keep installed software and security updates current. When you want to move to a newer Linux distribution release, use the release upgrade procedure recommended for that specific distribution.

Keeping Linux updated helps maintain a secure and reliable system while providing access to bug fixes, security updates, hardware compatibility improvements, and newer software.

If you found this guide helpful, you may also want to read How to Install Chrome on Linux.