CentOS Linux 8 was discontinued at the end of 2021. Check out more information about that in this in this article CentOS Linux 8 will end in 2021 and shifts focus to CentOS Stream.
The team at CentOS decided to shift focus to CentOS stream, an upstream version of RHEL. CentOS stream places itself between Fedora Linux and RHEL. It is not 100% RHEL clone but ahead of RHEL development. Other distros that are 100% compatible with RHEL 8 have come up including Rocky Linux and Alma Linux.
In this guide, we will learn how to convert an existing CentOS 8 distro into Centos 8 Stream without reinstalling a new operating system.
Table of Content
- Ensure your system is up to date
- Backup your CentOS Linux system
- Install CentOS Stream package
1. Ensure your system is up to date
Ensure that the server is updated using this command:
sudo dnf update -y
Let us also verify CentOS Linux 8 version using this command:
$ cat /etc/os-release NAME="CentOS Linux" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8"
2. Backup your CentOS 8 system
It is a good practice to ensure periodic updates on your system. If you have application data in the system ensure that it is backed up. Please also make OS snapshot to revert back when something goes wrong. Always keep verified backups.
3. Install CentOS Stream Package
Use this command to install the CentOS-Stream package:
sudo dnf install -y centos-release-stream
4. Convert the system from CentOS 8 to CentOS Stream
After installing the required package, we can start migrating from CentOS 8 to CentOS Stream. First, we must swap repos. This command will remove the CentOS 8 repos and replace it with the CentOS Stream repos. We will get all updates and libs/apps from CentOS Stream.
sudo dnf swap centos-linux-repos centos-stream-repos
List the repos with this command:
sudo dnf repolist
$ sudo dnf repolist repo id repo name appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS extras CentOS Stream 8 - Extras
Next, we need to get packages for CentOS Stream ABI/API. This will upgrade or downgrade packages to match the new ABI/API and break 100% RHEL compatibility due to ABI/API change. Use this command to achieve that:
sudo dnf distro-sync
5. Reboot the system
We need to reboot the system to ensure that the changes have been applied. Use this command to reboot the system:
sudo systemctl reboot
6. Verifying the migration
Once the reboot is done, login to the server and confirm that it was successful. Verify the version to make sure we are now switched to Centos 8 Stream using this command:
$ cat /etc/os-release NAME="CentOS Stream" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Stream 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
We can also check the CentOS release file
$ cat /etc/centos-release CentOS Stream release 8
Checking the hostname with hostnamectl will also reveal the info
$ cat /etc/centos-release CentOS Stream release 8 [[email protected] ~]$ hostnamectl Static hostname: dev-ce8-1-srv.citizix.com Icon name: computer-vm Chassis: vm Machine ID: 4d78db4a684b6f64404255df88b2c437 Boot ID: 2f9319edf2ed4c7a9b32f397ed338c32 Virtualization: kvm Operating System: CentOS Stream 8 CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-358.el8.x86_64 Architecture: x86-64