Upgrade CentOS 8 to CentOS Stream

Updated on March 4, 2022

As you all know, CentOS 8 has reached its EOL on 31st Dec 2021, it’s time to upgrade your CentOS 8 Linux to CentOS Stream, which is the future of the CentOS Project. CentOS has shifted its focus from CentOS to CentOS stream, which is a midstream between Fedora and RHEL. If you plan to upgrade CentOS 7 to CentOS 8, then it’s better to skip upgrading to CentOS 8 as CentOS 7 will get the support until 2024! If it is unavoidable to upgrade, then upgrade to CentOS Stream as below:

Step 1: Update your CentOS 8 to the latest release

# dnf update -y

Step 2: Check the OS version

# more /etc/redhat-release
CentOS Linux release 8.5.2111

Step 3: Update to the latest CentOS Stream release package. This makes your system look for the CentOS Stream repo rather than CentOS 8 repo.

# dnf install centos-release-stream -y --allowerasing

Last metadata expiration check: 0:01:38 ago on Thu 10 Feb 2022 05:07:08 PM IST.
Package centos-release-stream-8.1-1.1911.0.7.el8.x86_64 is already installed.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
centos-stream-release noarch 8.6-1.el8 Stream-BaseOS 22 k
replacing centos-linux-release.noarch 8.5-1.2111.el8
replacing centos-release-stream.x86_64 8.1-1.1911.0.7.el8
Installing dependencies:
centos-stream-repos noarch 8-3.el8 extras 19 k
Removing dependent packages:
centos-linux-repos noarch 8-3.el8 @baseos 26 k

Transaction Summary
=============================================================================================================================================================
Install 2 Packages
Remove 1 Package

Total download size: 42 k
Downloading Packages:
(1/2): centos-stream-release-8.6-1.el8.noarch.rpm 4.2 kB/s | 22 kB 00:05
(2/2): centos-stream-repos-8-3.el8.noarch.rpm 1.6 kB/s | 19 kB 00:11
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.4 kB/s | 42 kB 00:17
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: centos-stream-release-8.6-1.el8.noarch 1/1
Installing : centos-stream-release-8.6-1.el8.noarch 1/5
Installing : centos-stream-repos-8-3.el8.noarch 2/5
Obsoleting : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 3/5
Obsoleting : centos-linux-release-8.5-1.2111.el8.noarch 4/5
Erasing : centos-linux-repos-8-3.el8.noarch 5/5
warning: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo saved as /etc/yum.repos.d/CentOS-Linux-PowerTools.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Plus.repo saved as /etc/yum.repos.d/CentOS-Linux-Plus.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo saved as /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-FastTrack.repo saved as /etc/yum.repos.d/CentOS-Linux-FastTrack.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Extras.repo saved as /etc/yum.repos.d/CentOS-Linux-Extras.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-Devel.repo saved as /etc/yum.repos.d/CentOS-Linux-Devel.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo saved as /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-BaseOS.repo saved as /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.rpmsave
warning: /etc/yum.repos.d/CentOS-Linux-AppStream.repo saved as /etc/yum.repos.d/CentOS-Linux-AppStream.repo.rpmsave

Running scriptlet: centos-linux-repos-8-3.el8.noarch 5/5
Verifying : centos-stream-repos-8-3.el8.noarch 1/5
Verifying : centos-stream-release-8.6-1.el8.noarch 2/5
Verifying : centos-linux-release-8.5-1.2111.el8.noarch 3/5
Verifying : centos-release-stream-8.1-1.1911.0.7.el8.x86_64 4/5
Verifying : centos-linux-repos-8-3.el8.noarch 5/5

Installed:
centos-stream-release-8.6-1.el8.noarch centos-stream-repos-8-3.el8.noarch
Removed:
centos-linux-repos-8-3.el8.noarch

Complete!

Step 4: Synchronize the installed packages to the latest available versions.

# dnf distro-sync -y

Step 5: Validate the OS release

# more /etc/redhat-release
CentOS Stream release 8

That’s It! Worried about the lifetime of CentOS Stream? Then switch to a different distribution such as Rocky Linux, AlmaLinux, or Oracle Linux that provides LONG TERM SUPPORT (LTS).

On the other side, installing CentOS 8 and stuck with an error “Failed to download metadata for repo”? Here’s a fix.

Was this article helpful?

Related Articles

Comments Leave a Comment

  1. The first time I attempted the steps outlined above, I was unsuccessful, but the second time I tried, I was successful.
    I am very grateful.

  2. The “dnf distro-sync -y” step needed an extra “–allowerasing” to work.

Leave a Comment