System upgrade

LPIC-1LINUX

4/6/2026

1. Debian / Ubuntu (apt)

This is a two-step process: first synchronizing the package index, then performing the upgrade.

  • Update the package list: sudo apt update

  • Upgrade packages: sudo apt upgrade

  • Full system upgrade (handles dependency changes): sudo apt full-upgrade

2. RHEL / CentOS / Fedora (dnf or yum)

dnf (Dandified YUM) is the successor to yum. On newer versions of Fedora or RHEL, yum is often just a symbolic link to dnf.

  • Check for and apply updates: sudo dnf upgrade

  • Or using the older syntax: sudo yum update

3. openSUSE (zypper)
  • Update installed packages with newer versions: sudo zypper up

  • Distribution upgrade (recommended for Tumbleweed/rolling release): sudo zypper dup

Checklist on Best Practices
1 Reboot after a kernel update

Regardless of the manager, it is a good habit to reboot your system after a kernel update to ensure the new kernel is initialized. You can check if a reboot is required on many systems by looking for the existence of the file /var/run/reboot-required .

2 Create a snapshot (VM)

Before upgrading the system, create a snapshot, if your OS is running as a VM.

3 Data Backups

Snapshots are great for the OS, but Backups are for the data. A snapshot usually lives on the same disk; if the hardware fails, the snapshot dies too.

  • Use rsync* for file transfers, or maybe take a look at utilities like BorgBackup / Timeshift for incremental, compressed backups.

  • Always back up to an external drive or a remote server.

4 Verify Disk Space before Upgrade

One of the most common causes of "broken" updates is running out of disk space halfway through. The package manager downloads the .deb or .rpm files to a cache (usually /var/cache/) before installing them.

  • Run df -h to ensure you have at least 2GB–5GB of free space.

  • Run sudo apt clean or sudo dnf clean all to remove old cached packages and free up room for the new ones.

5 Configuration Backups (/etc)

Almost all system configuration lives in /etc.

  • If an update changes a service's configuration format, your custom settings might be overwritten.

  • tar -cvzf etc_backup_$(date +%F).tar.gz /etc

6 Power & Connectivity Stability

If the system loses power during the "unpacking" phase, your package database can become corrupted.

  • Laptops: Always plug into AC power.

  • Remote Servers: Use a terminal multiplexer like tmux or screen. If your SSH connection drops, the upgrade process will keep running on the server instead of being killed by the hangup signal (SIGHUP).

7 Check Log Files and Known Issues

For "mission-critical" updates (like moving from one major version to another), check the distribution's mailing list or forums.

*Warning on using rsync: if rsync is not configured properly, it may delete your data instead of making a copy of it! My recommendation is to practice first with different options until you feel confident. Be extra careful if you use rsync inside a script that you are using the right variables in place!