How to Upgrade Linux-Based Server Distributions#
Upgrading Debian, Ubuntu Server, and Fedora Server Versions#
Upgrading the operating system is an important step for maintaining security, stability, and getting new features. In this article we’ll look at how to safely upgrade versions of popular server distributions: Debian, Ubuntu Server, and Fedora Server.
1. Debian#
Debian is known for its stability, but upgrading to a new version may require some preparation steps.
Upgrade Procedure#
- Check the current version
lsb_release -aorcat /etc/debian_version
- Update the current packages
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo apt autoremove -y- Change the package sources
Edit the /etc/apt/sources.list file, replacing the old release name with the new one:
# Old:
deb http://deb.debian.org/debian/bullseye main contrib non-free
# New:
deb http://deb.debian.org/debian/bookworm main contrib non-free- Upgrade to the new version
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo reboot- Check the version after the upgrade
lsb_release -a2. Ubuntu Server#
Ubuntu Server is upgraded using do-release-upgrade.
Upgrade Procedure#
- Check the current version
lsb_release -a2. Update all packages of the current version
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremove -y3. Run the version upgrade
sudo do-release-upgradeIf the upgrade doesn’t start, make sure the
update-manager-corepackage is installed:
sudo apt install update-manager-core4. Follow the upgrade wizard’s instructions
Usually you’ll need to confirm replacing configuration files and a reboot.
5. Check the version after the upgrade
lsb_release -a3. Fedora Server#
Fedora Server uses the dnf tool to upgrade to a new version.
Upgrade Procedure#
- Check the current version
cat /etc/fedora-release- Update the current system
sudo dnf upgrade --refresh -y
sudo dnf autoremove -y- Install the version-upgrade plugin
sudo dnf install dnf-plugin-system-upgrade -y- Download the new version
sudo dnf system-upgrade download --releasever=43Replace
43with your target Fedora version.
- Apply the upgrade
sudo dnf system-upgrade reboot- Check the version after the upgrade
cat /etc/fedora-release4. Cheat Sheet: Upgrading Debian, Ubuntu Server, and Fedora Server#
This table contains the main commands for safely upgrading Linux server distributions.
| Distribution | Check Version | Update Current Packages | Upgrade OS Version | Notes |
|---|---|---|---|---|
| Debian | lsb_release -acat /etc/debian_version | sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y && sudo apt autoremove -y | 1. Change /etc/apt/sources.list to the new version2. sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y && sudo reboot | Upgrading via apt requires carefully editing the package sources. |
| Ubuntu Server | lsb_release -a | sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y | sudo do-release-upgrade | Make sure update-manager-core is installed. Follow the wizard’s instructions. |
| Fedora Server | cat /etc/fedora-release | sudo dnf upgrade --refresh -y && sudo dnf autoremove -y | 1. sudo dnf install dnf-plugin-system-upgrade -y2. sudo dnf system-upgrade download --releasever=<target_version>3. sudo dnf system-upgrade reboot | Replace <target_version> with the desired Fedora version. |
5. Upgrade Recommendations#
- Always back up important data before upgrading.
- Read the official guides and release notes for the version you’re upgrading to.
- On servers with critical services, it’s better to test the upgrade on a separate machine or virtual environment first.
- After upgrading, check the status of services and logs (
systemctl statusandjournalctl).
In summary, the upgrade process differs slightly between Debian/Ubuntu and Fedora, but the basic principle is the same - first update the current packages, then safely move to the new version using the built-in tools.




