This guide covers upgrading from CentOS 7 to CentOS 8 Stream, focusing on a smooth, data-safe transition. With CentOS 7 ending in June 2024 and the shift to CentOS Stream 8, the guide is vital for those planning the upgrade.
While transitioning from CentOS 7 to CentOS Stream 8 can provide opportunities to align with the evolving direction of the CentOS project and benefit from closer integration with Red Hat Enterprise Linux (RHEL) development, it’s essential to approach such changes cautiously. Preserving crucial data and configurations should be a top priority throughout the transition process. The goal of this guide is to offer you a thorough roadmap for migrating your CentOS 7 system to CentOS Stream 8 while maintaining the integrity of your data. By meticulously converting CentOS 7 to CentOS 8 and then to CentOS 8 Stream by following these steps, you can navigate the transition with confidence, ensuring a smooth and seamless migration process.
Ensuring data integrity cannot be overstated. Before beginning the conversion process, back up all critical data, including system files, user data, and configuration files. Tools like rsync, tar, and external backup services can be utilized.
Also Read:
Setup Linux VPS Backup Server using Rsync
Before upgrading to CentOS Stream 8, make sure your existing CentOS 7 system is properly updated. This step lowers the possibility of conflict of packages throughout the conversion process. To update it, execute the following command:
sudo yum update -y
Since CentOS 8 has a different package set compared to CentOS 7, some packages that were available in CentOS 7 might not be available in CentOS 8’s default repositories. Ensuring that you have access to a wider range of software packages during and after the transition by installing the EPEL repository beforehand will be the best solution for it. To do this execute the command:
sudo yum install epel-release -y
To manage RPM package configuration files to avoid conflicts that arise during package updates, install rpmconf
utility and check the configuration files of all installed packages:
sudo yum install rpmconf -y
sudo rpmconf -a
Simplify package management and repository handling for transitioning from CentOS 7 to CentOS 8 by install yum-utils which is needed for removing packages:
sudo yum install yum-utils -y
After installing yum-utils, go ahead with removing all yum packages that are not required by using the commands:
sudo package-cleanup --leaves
sudo package-cleanup --orphans
After successful removal reboot the system!
CentOS 8 and distributions based on RHEL 8 have moved from using yum
package manager as their primary package management tool to dnf
package manager. Therefore yum is no longer needed for us and we now need dnf
. When the server becomes online again after the reboot, access the server and remove yum
followed by installing dnf
.
sudo yum install dnf -y
sudo dnf remove yum yum-metadata-parser -y
sudo rm -Rf /etc/yum
Now, upgrade your CentOS 7 server to CentOS 8 with dnf
package manager:
sudo dnf update -y
After updating, install CentOS 8 release package and upgrade with the installed package:
sudo dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm} -y
sudo dnf upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
Remove all cached packages and metadata and go ahead with removing CentOS 7 kernel:
sudo dnf clean all
sudo rpm -e `rpm -q kernel`
To ensure a smoother transition and to provide a safety net for compatibility with legacy software and scripts, install sysvinit-tools
. This minimizes the potential for system management issues.
The system will now fully function as a CentOS 8 OS. The remaining step is to transition it to CentOS 8 Stream OS.
Inorder to do it, update the system and then install stream CentOS 8 release stream repository:
sudo dnf update -y
sudo dnf install centos-release-stream -y
Adjust your system’s repositories to point to CentOS Stream instead of the standard CentOS repositories:
sudo dnf swap centos-linux-repos centos-stream-repos -y
Now, synchronize your installed packages with the versions in CentOS Stream. This step upgrades your system to the Stream version.
sudo dnf distro-sync -y
After the synchronization process completes, verify that your system has been successfully converted to CentOS Stream with the command:
cat /etc/centos-release
Your output should look like this:
Following these steps will complete your CentOS 7 to CentOS 8 Stream Migration smoothly and efficiently, you’ve successfully transitioned your system to CentOS Stream, paving the way for a more dynamic and updated operating environment. 😎🎉
Related Tutorials:
How to Migrate CentOS 8 to AlmaLinux
How to Upgrade from CentOS 8 Stream to CentOS 9 Stream