How to Convert CentOS 8 to CentOS Stream
If you are using CentOS 7 and plan to upgrade CentOS 7 to CentOS 8 then better avoid upgrading to CentOS 8 as CentOS 8 support ends by the end of 2021 while CentOS 7 will be supported till 2024.
Red Hat and CentOS recently announced that CentOS 8 will be converted to CentOS Stream. So if you are using CentOS 8 then it is recommended to migrate your system from CentOS 8 to CentOS Stream.
In this tutorial, we will show you how to migrate from CentOS 8 to CentOS Stream.
Prerequisites
- A server running CentOS 8.
- A root password is configured on the server.
Update the System
Before starting, it is a good idea to update your system to the latest version. You can update it by running the following command:
dnf update -y
Once your system is updated, restart it to apply the changes:
reboot
Once your system is restarted, verify your system version with the following command:
cat /etc/centos-release
You should get the following output:
CentOS Linux release 8.3.2011
Upgrade from CentOS 8 to CentOS Stream
First, you will need to install the CentOS Stream release package in your system. You can install it with the following command:
dnf install centos-release-stream -y
This will install CentOS Stream reposiotry to the /etc/yum.repos.d directory:
CentOS Linux 8 - AppStream 2.4 MB/s | 6.3 MB 00:02 CentOS Linux 8 - BaseOS 1.3 MB/s | 2.3 MB 00:01 Last metadata expiration check: 0:00:01 ago on Saturday 09 January 2021 03:53:01 AM EST. Dependencies resolved. =============================================================================================================================================== Package Architecture Version Repository Size =============================================================================================================================================== Installing: centos-release-stream x86_64 8.1-1.1911.0.7.el8 extras 11 k Transaction Summary =============================================================================================================================================== Install 1 Package Total download size: 11 k Installed size: 6.6 k Downloading Packages: centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm 195 kB/s | 11 kB 00:00 ----------------------------------------------------------------------------------------------------------------------------------------------- Total 9.6 kB/s | 11 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 1/1 Verifying : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 1/1 Installed: centos-release-stream-8.1-1.1911.0.7.el8.x86_64 Complete!
Next, you will need to remove the CentOS 8 repository file from your system. You can remove all with the following command:
dnf swap centos-{linux,stream}-repos -y
You should get the following output:
Last metadata expiration check: 0:00:19 ago on Saturday 09 January 2021 03:53:29 AM EST. Dependencies resolved. =============================================================================================================================================== Package Architecture Version Repository Size =============================================================================================================================================== Installing: centos-stream-release noarch 8.4-1.el8 Stream-BaseOS 21 k replacing centos-linux-release.noarch 8.3-1.2011.el8 replacing centos-release-stream.x86_64 8.1-1.1911.0.7.el8 centos-stream-repos noarch 8-2.el8 Stream-BaseOS 19 k Removing: centos-linux-repos noarch 8-2.el8 @BaseOS 26 k Transaction Summary =============================================================================================================================================== Install 2 Packages Remove 1 Package Total download size: 40 k Downloading Packages: (1/2): centos-stream-release-8.4-1.el8.noarch.rpm 116 kB/s | 21 kB 00:00 (2/2): centos-stream-repos-8-2.el8.noarch.rpm 101 kB/s | 19 kB 00:00 ----------------------------------------------------------------------------------------------------------------------------------------------- Total 144 kB/s | 40 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: centos-stream-repos-8-2.el8.noarch 1/1 Installing : centos-stream-repos-8-2.el8.noarch 1/5 Installing : centos-stream-release-8.4-1.el8.noarch 2/5 Obsoleting : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 3/5 Obsoleting : centos-linux-release-8.3-1.2011.el8.noarch 4/5 Erasing : centos-linux-repos-8-2.el8.noarch 5/5 Running scriptlet: centos-linux-repos-8-2.el8.noarch 5/5 Verifying : centos-stream-release-8.4-1.el8.noarch 1/5 Verifying : centos-linux-release-8.3-1.2011.el8.noarch 2/5 Verifying : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 3/5 Verifying : centos-stream-repos-8-2.el8.noarch 4/5 Verifying : centos-linux-repos-8-2.el8.noarch 5/5 Installed: centos-stream-release-8.4-1.el8.noarch centos-stream-repos-8-2.el8.noarch Removed: centos-linux-repos-8-2.el8.noarch Complete!
Next, you will need to sync all the packages to the latest version. You can do it with the following command:
dnf distro-sync -y
This command will take some time to sync all packages. Once you are finished, restart your system to apply the configuration changes:
reboot
Next, verify your system with the following command:
cat /etc/centos-release
Your system is now upgraded to the CentOS Stream as shown below:
CentOS Stream release 8
You can also verify your repository with the following command:
ls /etc/yum.repos.d/
You should see the following output:
CentOS-Stream-AppStream.repo CentOS-Stream-Debuginfo.repo CentOS-Stream-HighAvailability.repo CentOS-Stream-PowerTools.repo CentOS-Stream-BaseOS.repo CentOS-Stream-Extras.repo CentOS-Stream-Media.repo CentOS-Stream-RealTime.repo
Conclusion
Congratulations! you have successfully upgrade your CentOS 8 system to CentOS Stream. Feel free to ask me if you have any questions.