The CentOS 7 operating system is supported until June 2024, but users are looking to upgrade to CentOS 8 to take advantage of new features and security improvements. However, note that directly upgrading from CentOS 7 to CentOS 8 is a complicated process, because CentOS 8 works based on dnf packages instead of yum and there have been fundamental changes to the system structure. In this tutorial from Radib, we are going to teach you how to upgrade CentOS, stay with Radib until the end of this tutorial.
Steps to upgrade CentOS 7 to CentOS 8
1. Backing up your system
Before doing anything, it is essential to back up your current system, including your data, settings, and important files. You can use tools like rsync
or tar
to do this:
rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*"} /backup/
2. Check the installed CentOS version
To buy an hourly cloud server at the best price from Radib, click
To find out the current operating system version, run the following command:
cat /etc/centos-release
3. Updating CentOS 7 Packages
Before starting the upgrade process, the system must be updated to the latest CentOS 7 release:
sudo yum update -y
sudo reboot
4. Installing the Upgrade Prerequisite Tool
CentOS provides an official tool called Leapp that is designed to help you migrate from CentOS 7 to CentOS 8. To install this tool, run the following commands:
sudo yum install leapp-upgrade leapp-data-centos -y
5. Run a pre-upgrade assessment
The Leapp tool performs a pre-upgrade assessment to identify potential issues:
sudo leapp preupgrade
If you see any errors, review and resolve them. Some common issues include incompatible packages and outdated settings.
6. Run the upgrade process
After fixing the assessment issues, start the upgrade with the following command:
sudo leapp upgrade
Buy virtual server from over 25 different countries with the best quality and price from Radib,Click
This process may take some time. Once completed, reboot the system:
sudo reboot
7. Check if the upgrade was successful
After rebooting, check if the system is running CentOS 8:
cat /etc/centos-release
8. Reinstall required packages
Some packages may have been removed during the upgrade process. You can reinstall them using the dnf
tool:
sudo dnf install <package-name>
Important notes before upgrading:
- Some specific services such as cPanel and Plesk may be incompatible with CentOS 8.
- CentOS 8 has been changed to CentOS Stream due to a change in support policy, so check if CentOS Stream is suitable for your needs.
- Using Rocky Linux or AlmaLinux as alternatives to CentOS 8 can also be a better option.
If you encounter any problems during the upgrade process or need further advice, please contact Radib via the support ticket section, our experts are available 24/7.