8

Is there any way to do a sort of in-place upgrade to CentOS Stream? I'm currently running CentOS 8 and for various reasons would like to switch over to the new Stream version. Is it possible to do without having to reinstall the OS?

4 Answers 4

8

After, it was announced that CentOS 8 would no longer be supported (end-of-life on 31 December 2021), upgrading to CentOS Stream became the officially recommended path to continue to receive software updates (RPMs).

Here are the notes I made while following the instructions for Converting from CentOS Linux to CentOS Stream:

1. Install the CentOS-Stream release files.

dnf install centos-release-stream

This package installs the following files:

/etc/dnf/vars/stream
/etc/yum.repos.d/CentOS-Stream-AppStream.repo
/etc/yum.repos.d/CentOS-Stream-Base.repo
/etc/yum.repos.d/CentOS-Stream-Debuginfo.repo
/etc/yum.repos.d/CentOS-Stream-Extras.repo
/etc/yum.repos.d/CentOS-Stream-Media.repo
/etc/yum.repos.d/CentOS-Stream-PowerTools.repo
/etc/yum.repos.d/CentOS-Stream-Sources.repo
/etc/yum.repos.d/CentOS-Stream-Vault.repo
/etc/yum.repos.d/CentOS-Stream-centosplus.repo

2. Replace the centos-linux repositories with centos-stream repositories:

dnf swap centos-{linux,stream}-repos

The above utilises Bash’s brace expansion to run this command:

dnf swap centos-linux-repos centos-stream-repos

which replaces the following packages:

centos-release-stream
centos-release
centos-repos

with

centos-stream-repos
centos-stream-release

3. Update all packages to match the latest version available from all enabled repositories

sudo dnf distro-sync

For me, this installed a large number of packages, removed older kernel packages and downgraded the following packages:

httpd-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64
httpd-filesystem-2.4.37-30.module_el8.3.0+462+ba287492.0.1.noarch
httpd-tools-2.4.37-30.module_el8.3.0+462+ba287492.0.1.x86_64

However, it failed while attempting to upgrade the filesystem package and further attempts to run dnf update failed due to:

Error unpacking rpm package filesystem-3.8-4.el8.x86_64

This was because I had a filesystem mounted on /mnt. Unmounting this allowed the filesystem package to be upgraded and allowed the operation to complete successfully:

$ cat /etc/centos-release
CentOS Stream release 8

Note: I’ve only converted my own workstation to CentOS Stream. I have yet to replicate this procedure on a production server. :)

1
  • 1
    Your note about the filesystem package is interesting, because I have a few LXC containers with the same issue, but haven't been bothered to figure out why. Thanks for all the info!
    – Fumbles
    Commented Feb 12, 2021 at 16:08
5

Edit: Please check out Anthony Geoghegan's answer for the latest recommendations.

This should work as CentOS Stream is just additional repositories on top of CentOS 8 as mentioned on (unofficial) centosfaq.org.

I did this on my development machine:

$ dnf history centos-release-stream
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   156 | update --allowerasing    | 2020-03-27 14:10 | E, I, U        |  127  <
   154 | install -y centos-releas | 2020-03-27 14:04 | Install        |    1 > 

Which resulted in the following enabled repositories

$ dnf repolist enabled | grep CentOS
AppStream                 CentOS-8 - AppStream
BaseOS                    CentOS-8 - Base
PowerTools                CentOS-8 - PowerTools
Stream-AppStream          CentOS-Stream - AppStream
Stream-BaseOS             CentOS-Stream - Base
Stream-extras             CentOS-Stream - Extras
centosplus                CentOS-8 - Plus
extras                    CentOS-8 - Extras
fasttrack                 CentOS-8 - fasttrack

I needed to get rid of some manually compiled packages (--allowerasing) though. I would not do this on a production server or without a functioning backup.

1
  • 3
    Just to clarify: To switch from a "normal" CentOS 8 installation to Stream, you have to dnf install centos-release-stream followed by a dnf update. Then your /etc/redhat-release will read: CentOS Stream release 8.
    – mbirth
    Commented Oct 5, 2020 at 13:17
1

If you reach Centos 8 end of life and can't update using

dnf install centos-release-stream

Because Centos 8 repos are gone, you can search for the package centos-release-stream on the net download it to your Centos 8 and use

dnf install centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm

as a local file, then continue the procedure mention on this post. It works, for me.

1
  • Where can I get that file?
    – Beginner
    Commented Mar 4, 2022 at 21:45
-1

Not that I know of. Backup your system and boot a Stream image of your choice to install it. Make sure you look at the release notes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .