Other

Linux Update: Complete Guide for All Distributions

This guide thoroughly explains the Linux OS update process. You'll learn how to properly prepare your system, perform updates via package managers, and verify results for security and stability.

Updated at February 15, 2026
15-30 minutes
Medium
FixPedia Team
Применимо к:Ubuntu 20.04/22.04 LTSDebian 10/11/12CentOS 7/8Fedora 35-40Arch LinuxAll distributions with apt/yum/dnf/pacman

Introduction / Why This Is Needed

Regular Linux updates are a key practice for maintaining your system's security, stability, and currency. Updates patch vulnerabilities, fix bugs, and provide new features. This guide will help you safely and correctly update most popular Linux distributions, avoiding common pitfalls.

After completing it, you will have an up-to-date system with the latest fixes and improvements.

Requirements / Preparation

Before you begin, ensure the following conditions are met:

  • Administrator privileges: You will need sudo access or a root login.
  • Stable internet connection: Updates are downloaded from repositories.
  • Free disk space: At least 1-2 GB for temporary files and updates.
  • Backup (recommended):
    • Back up important data in your home directory (/home) and configuration files (/etc).
    • If possible, take a system snapshot via LVM, Btrfs, or your virtualization tool.
  • No interrupted operations: Complete any pending package installations (dpkg, apt, yum, etc.) and close applications.

Step-by-Step Instructions

Step 1: Identify Your Distribution's Package Manager

Linux distributions use different package managers. Run one of the commands below to find out which one your system uses.

For Debian/Ubuntu-based distributions (apt):

which apt

If the command returns a path (e.g., /usr/bin/apt), you have apt.

For RHEL/CentOS/Fedora (yum/dnf):

which yum

or

which dnf

For Arch Linux (pacman):

which pacman

You can also check the /etc/os-release file:

cat /etc/os-release

Pay attention to the ID or NAME field.

💡 Tip: If you have multiple managers (e.g., both apt and snap), update your system via the distribution's primary manager (apt for Ubuntu/Debian).

Step 2: Update the Package Cache

The package cache contains information about available software versions. It must be updated so the package manager knows about the latest versions.

For apt (Debian, Ubuntu, Mint and derivatives):

sudo apt update

This command synchronizes your local package lists with the repositories.

For yum (CentOS 7, RHEL 7):

sudo yum check-update

The command checks for updates but does not install them.

For dnf (CentOS 8+, Fedora, RHEL 8+):

sudo dnf check-update

For pacman (Arch Linux, Manjaro):

sudo pacman -Sy

The -Sy flag updates the package database.

⚠️ Important: On Arch Linux, avoid using sudo pacman -Syy (double y) unless it's required to force a database update. This can cause synchronization issues.

Step 3: Install System Updates

After updating the cache, install the available updates.

For apt:

sudo apt upgrade

This command upgrades all packages without removing or installing new dependencies. For a full upgrade (including package removal or new dependencies), use:

sudo apt full-upgrade

Usually, upgrade is sufficient.

For yum:

sudo yum update

For dnf:

sudo dnf update

For pacman:

sudo pacman -Syu

The -Syu flag synchronizes, refreshes, and upgrades the entire system.

⚠️ Important: During the update, you may be prompted about configuration files (e.g., if you modified files in /etc). Read messages carefully. If unsure, keep the local version (by default, apt or dnf saves a copy with extensions like .dpkg-old or .rpmnew).

Step 4: Reboot the System (If Required)

A reboot is mandatory after a kernel or core system library (e.g., glibc, systemd) update. Otherwise, the system may run unstably.

Run:

sudo reboot

Or, if you are in a graphical environment, use the shutdown menu.

💡 Tip: To check if a reboot is needed on Ubuntu/Debian, use:

ls /var/run/reboot-required

If the file exists, a reboot is required. On other distributions, check if the kernel was updated:

uname -r

and compare it with the installed kernel package version (e.g., rpm -qa | grep kernel for yum/dnf).

Step 5: Verify the Update Result

After rebooting, ensure the update was successful.

  1. Check the distribution version:
    lsb_release -a
    

    or
    cat /etc/os-release
    
  2. Check the kernel version:
    uname -r
    
  3. Ensure there are no pending updates (repeat steps 2 and 3):
    sudo apt update && sudo apt list --upgradable
    

    The list should be empty.
  4. Check service status:
    systemctl list-units --state=failed
    

    There should be no services in a failed state.

Result Verification

In short, the system is updated if:

  • The command sudo apt list --upgradable (or its equivalent for your manager) shows no packages.
  • The distribution version (lsb_release -d) matches the expected one (e.g., after upgrading from Ubuntu 20.04 to 22.04).
  • All critical services (systemctl) are running without errors.
  • A reboot is no longer required (the /var/run/reboot-required file is absent).

Potential Issues

"Not Enough Disk Space" Error

Symptom: The package manager reports insufficient space. Solution:

  1. Clean the package cache:
    sudo apt clean   # for apt
    sudo dnf clean all   # for dnf
    sudo pacman -Sc   # for pacman (caution: removes old versions)
    
  2. Remove unnecessary packages:
    sudo apt autoremove   # for apt
    sudo dnf autoremove   # for dnf
    
  3. Free up space manually (old logs, temporary files).

Update Failure Due to Network Problems

Symptom: Connection drops, 404 Not Found, Temporary failure resolving errors. Solution:

  1. Check your internet connection:
    ping -c 3 8.8.8.8
    
  2. Switch to a different mirror (repository). For Ubuntu/Debian, edit /etc/apt/sources.list; for other distributions, adjust your package manager's configuration.
  3. Retry the update. Package managers (apt, dnf, pacman) usually resume downloads.

Package Conflicts or Dependencies

Symptom: Messages about "unmet dependencies" or "conflicts". Solution:

  1. For apt, try fixing dependencies:
    sudo apt --fix-broken install
    
    Then run sudo apt upgrade again.
  2. For dnf/yum:
    sudo dnf distro-sync   # synchronizes packages with repositories
    
  3. If the issue persists, manually identify the conflicting packages (the message will list them) and try removing/reinstalling them.

Configuration File Errors

Symptom: When updating a package, the manager asks whether to keep your current config. Solution: If you didn't make important changes to the config, you can install the updated version (choose "Yes"). If the config was modified manually, keep the local version (choose "No" or preserve the old file). After updating, compare the files (diff /etc/package.conf /etc/package.conf.dpkg-old) and merge changes if necessary.

F.A.Q.

Do I need to create a backup before updating Linux?
Can Linux be updated without a reboot?
What to do if the update was interrupted due to a network error?
How to roll back an update in Linux?

Hints

Identify your distribution's package manager
Update package cache
Install system updates
Reboot the system
Verify the update result
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community