Sub topic 10
Compatibility, Major Upgrades, and Switching Distributions
This chapter assumes you can run apt and dnf, read systemd unit status, and have followed the earlier chapters on release cadence, repositories, and package management. It covers what stays compatible when you move to a new release, how each family handles major upgrades, and what switching distributions costs.
Three kinds of change
"Upgrade" covers three different operations, and the risk of each differs.
- Updates within a release. Security and bug-fix packages on the same release, such as
apt upgradeordnf update. Risk is low on all three distributions. - Major upgrades. A move to the next release, such as Ubuntu 22.04 to 24.04, Debian 12 to 13, or Rocky 8 to 9. Library versions, default configuration, and service behavior can all change.
- Switching distributions. A move across families or between a distribution and its derivative, such as Rocky to Ubuntu. Package names, paths, and security defaults all change.
Plan each one separately. A team that handles updates well can still be caught off guard by a major upgrade.
What "compatible" means
Compatibility has three layers.
- Binary (ABI) compatibility. A compiled program runs on a different system because the libraries it links to are still there with the same interfaces.
- Package compatibility. A
.debor.rpmfile installs because its dependencies can be met. - Configuration compatibility. The config files and tools you know still exist and behave the same.
Within the RHEL lineage
Rocky Linux aims to be bug-for-bug compatible with Red Hat Enterprise Linux (RHEL). Within one major version (8.x or 9.x), Red Hat preserves ABI stability for core libraries, so software built for RHEL 9.2 should run on Rocky 9.4. Across major versions that guarantee ends. Software built for 8 may need a rebuild or compatibility libraries on 9.
Within the Debian lineage
Debian and Ubuntu make no ABI promise across releases. Each release has its own libraries, and you are expected to use packages built for that release. Ubuntu starts from Debian packages, but the two diverge. A .deb taken from Debian may fail to install on Ubuntu, or install and then misbehave, because it was built against different library versions.
Why glibc matters
A binary built against a newer glibc, the C library, usually fails on a host with an older one. This is why a vendor tarball built on a recent distribution can break on an older one. Check the target host before you copy a binary there:
ldd --version | head -n 1The reverse direction normally works. A binary built on an older glibc runs on newer systems.
Upgrade paths compared
| Aspect | Ubuntu Server LTS | Debian stable | Rocky Linux |
|---|---|---|---|
| Official major-upgrade tool | `do-release-upgrade` | Edit APT sources, then `apt full-upgrade` | None from the Rocky project. Reinstall is the standard path. |
| In-place option | Supported, one LTS at a time | Supported, one stable release at a time | Community tooling (ELevate, based on `leapp`) |
| Skipping a release | Not supported | Not supported | Not applicable |
| When offered | LTS-to-LTS upgrades appear after the first point release (24.04.1) | Whenever the next stable release is out | Whenever you choose |
| Documentation to read first | Release notes | Release Notes for the new stable | Rocky and ELevate documentation |
Treat the ELevate row with care. It is a community project, and its supported paths and Rocky versions change. Read its current documentation before you plan around it.
Upgrading Ubuntu Server
Ubuntu uses a dedicated tool. By default, an LTS system is offered only the next LTS. The setting is in /etc/update-manager/release-upgrades:
grep '^Prompt' /etc/update-manager/release-upgradesPrompt=lts offers only LTS releases, Prompt=normal offers every release, and Prompt=never disables the check. On a server you almost always want lts.
A typical run looks like this:
sudo apt update
sudo apt full-upgrade
sudo reboot
sudo do-release-upgradeBring the current release fully up to date first, and reboot if a new kernel was installed. If you start do-release-upgrade over SSH, it warns you and opens a second sshd on port 1022 as a fallback. Run it inside tmux or screen anyway, so a dropped connection does not interrupt the upgrade halfway.
During the upgrade you are asked about each config file that you changed locally and the package maintainer also changed. Answer carefully. Keep your version if you do not understand the difference, then diff the files afterwards.
Upgrading Debian
Debian has no wrapper tool. The documented procedure is to edit your APT sources, then run the upgrade in two stages. This example moves from Debian 12 ("bookworm") to Debian 13 ("trixie"):
sudo apt update
sudo apt full-upgrade
sudo cp -a /etc/apt /root/apt-backup
sudo sed -i.bak 's/bookworm/trixie/g' /etc/apt/sources.list
sudo apt update
sudo apt upgrade --without-new-packages
sudo apt full-upgrade
sudo rebootKey points:
- The
sedcommand changes only/etc/apt/sources.list. Check/etc/apt/sources.list.d/too, because third-party repositories often live there. Those repositories may have no packages for the new release yet, so disable them first. upgrade --without-new-packagesis the cautious first pass. It upgrades what it can without installing or removing anything.full-upgradethen handles the dependency changes.- Read the Release Notes for the target version before you start. They list removed packages, renamed components, and changes that need manual action.
Upgrading Rocky Linux
Updates within a major version are simple:
sudo dnf upgradeMinor releases (9.3 to 9.4) arrive this way. There is no separate procedure.
A major version change is different. Rocky's normal guidance is to install the new version on a fresh system and move your data and configuration across. The RHEL-family design assumes you stay on one major version for its long support period, then plan a deliberate move. Rocky 8 and Rocky 9 each have roughly ten years of support. The ELevate project can upgrade in place, but it is still a larger operation than a Debian or Ubuntu upgrade and needs a tested rollback plan.
The reinstall approach has a side benefit. You rebuild from scratch and drop the leftover configuration that accumulated over the years. It costs more if your server was configured by hand and nobody wrote down how.
A safe upgrade workflow
The steps are the same on every distribution, and you should follow them whatever the tooling.
Build an inventory
Record what is installed, which repositories are enabled, and which services run. These commands save that state to files:
# Debian / Ubuntu
dpkg --get-selections > packages.txt
apt-cache policy > repos.txt
systemctl list-unit-files --state=enabled > services.txt
# Rocky Linux
rpm -qa --qf '%{NAME}\n' | sort > packages.txt
dnf repolist > repos.txt
systemctl list-unit-files --state=enabled > services.txtFor each package and repository, ask whether it comes from the distribution or from a third party. Third-party sources cause most upgrade failures. They may lack builds for the new release, or they may replace distribution packages with versions the new release cannot handle.
Test on a clone
A cloud snapshot, a virtual machine copy, or a restored backup is enough. The goal is to find out what breaks while nothing depends on it. Test the application, not just the operating system. Check that the service starts, that the config loads, and that a real request works.
Know what changes between releases
These are the areas that often change across a major release:
- Default versions of languages and databases (PHP, Python, PostgreSQL, MariaDB). A database major version change may need a data migration step.
- Deprecated or removed packages and tools.
- Cryptographic policy. Newer releases can disable old algorithms, such as SHA-1 signatures or old TLS versions, which breaks legacy clients.
- Network configuration tools. Ubuntu uses Netplan, Rocky uses NetworkManager, and Debian uses ifupdown or systemd-networkd depending on the installation.
- SELinux or AppArmor profiles. Profiles for your own applications may need updates.
Rollback
Packages do not downgrade cleanly across a release boundary. The only reliable rollback is a snapshot or backup taken before you started. Decide before the maintenance window how you would restore it and how long that would take.
Switching distributions
Moving between distributions means rebuilding the server and migrating its state. Some moves are easier than others.
| Move | Difficulty | Notes |
|---|---|---|
| CentOS 8, AlmaLinux, or RHEL to Rocky (same major version) | Low | Tools such as `migrate2rocky` convert in place. The package set is nearly identical. |
| Debian to Ubuntu or the reverse | Medium | No supported in-place conversion. Package names mostly match and tools are the same, but release timing and library versions differ. |
| Debian or Ubuntu to Rocky or the reverse | High | Different package manager, package names, config paths, firewall, and MAC system. Plan a rebuild. |
Common translation points
These are the differences that most often cause trouble after a switch:
| Item | Debian / Ubuntu | Rocky Linux |
|---|---|---|
| Apache package and service | `apache2` | `httpd` |
| Service defaults | `/etc/default/<name>` | `/etc/sysconfig/<name>` |
| Build tools | `build-essential` | `dnf group install "Development Tools"` |
| Firewall front end | `ufw` (Ubuntu) | `firewalld` |
| Mandatory access control | AppArmor | SELinux |
| Network configuration | Netplan (Ubuntu), `/etc/network/interfaces` (Debian) | NetworkManager |
Configuration management tools such as Ansible, Puppet, or Salt reduce this work, but only if the roles are written for both families. A role full of apt calls does not run on Rocky. Check that before you assume the migration is cheap.
Rebuild rather than convert
For a cross-family move, the usual method is:
- Build the new server from your inventory and configuration management.
- Install the application and restore its data.
- Test it alongside the old server.
- Switch traffic, for example through DNS or a load balancer, and keep the old server for a rollback period.
This method has a rollback built in, because the old system is still running.
Containers can reduce the dependency
If your application runs in a container, the host distribution matters less for compatibility. The libraries in the image come from the image, not from the host. The host still matters for the kernel, the firewall, and the security policy, but moving the host becomes a smaller job.
Putting costs on the decision
When you choose a distribution, include the cost of leaving it. Ask how many years of support the release gives you. Then ask how much work the next major move will be. A Rocky server that never needs more than one rebuild every ten years can cost less in labor than an Ubuntu server upgraded every two years, even if each Ubuntu upgrade is smooth. The reverse holds when the team already upgrades routinely and automates it.
Summary
- Rocky preserves ABI compatibility within a major version. Ubuntu and Debian expect you to use packages built for your release.
- Ubuntu upgrades with
do-release-upgrade, Debian by editing APT sources and runningfull-upgrade, and Rocky is normally reinstalled or moved with community tooling. - Do not skip releases. Upgrade one version at a time.
- Inventory, clone and test, back up, then upgrade.
- Third-party repositories and hand-edited config files are the main risks.
- Switching families means a rebuild, and automation makes it cheaper.
Exercise
A server runs Debian 12 and uses a third-party repository for a database. You want to move to Debian 13. List the steps you take before you edit /etc/apt/sources.list, and explain why you cannot simply run the upgrade on production first.
Show answer
Read the Debian 13 Release Notes. Fully update Debian 12 and reboot. Record installed packages and repositories (for example dpkg --get-selections and apt-cache policy). Check whether the third-party repository has packages for Debian 13, and disable it if it does not. Back up data and the /etc/apt directory, and take a snapshot. Clone the server and run the upgrade there, testing the database and the application. Running it first on production is unsafe because a failed upgrade cannot be rolled back with package tools, and problems such as a missing third-party package or a database version change only show up during the upgrade.
Exercise
Your team runs Ubuntu 22.04 LTS and wants Ubuntu 26.04 LTS. Can you upgrade directly? Which release must you pass through, and which setting in /etc/update-manager/release-upgrades controls which releases are offered?
Show answer
No. Ubuntu supports upgrading one release at a time, so you must go 22.04 to 24.04 and then 24.04 to 26.04. The setting is Prompt. Prompt=lts offers only LTS releases, Prompt=normal offers every release, and Prompt=never turns upgrade checks off.
Exercise
You must move a hand-configured Rocky Linux 8 server to Ubuntu Server. Name three things that will differ and describe the safest migration method.
Show answer
Any three of these: the package manager (dnf/rpm versus apt/dpkg), package names (httpd versus apache2), config locations (/etc/sysconfig versus /etc/default), the firewall front end (firewalld versus ufw), the mandatory access control system (SELinux versus AppArmor), and network configuration (NetworkManager versus Netplan). The safest method is a rebuild. Build the new server from an inventory or configuration management, restore the data, test it beside the old server, switch traffic, and keep the old server for a rollback period.