3

I looked into this a while back, and lots of people were saying it wasn't supported, and talking about "hacky" ways of doing it. That was 2 years ago though.

Some googling now suggests it might be as simple as:

dnf install dnf-plugin-system-upgrade
dnf system-upgrade download --releasever=9 --allowerasing
dnf system-upgrade reboot

But I'm unclear if my services (php, mariadb, etc) will continue to operate, or if I'd have to reinstall them and my data and conf files etc.

I could spin up a new server and install fresh, but would prefer to not jump through those hoops and upgrade this one, if people who see this question have tried it and have any words of wisdom or encouragement!

3 Answers 3

2

I've been researching this tonight, too. I have a "CentOS Stream release 8" VM in VirtualBox. I fully upgraded it and made a snapshot of it before testing the 3 lines you posted. I was warned to first run "sudo dnf --refresh upgrade" first so I did. Once I began the upgrade, I was met with suggestions to add "--skip-broken" and "--nobest". After adding both of those, I was able to trigger the update after a reboot. Now, however, I'm met with the inability to do much due to "This system is not registered with an entitlement server. You can use subscription-manager to register."

I renew a free RHEL Developer's License annually to keep my RHEL 9 VM operational but I've never needed to register a version of CentOS. I'm not sure if there's a registration required now or if this is just not such a great idea. Fortunately with that snapshot it was easy to rollback.

2
  • 1
    The message "This system is not registered with an entitlement server" is perfectly normal for any system which isn't RHEL with a valid subscription (so you'll see it on CentOS and even Fedora). It's not an error. Just ignore it unless you actually want to make use of an EL subscription.
    – TooTea
    Commented Apr 15 at 10:54
  • What do you say to TooTea's comment @Myke Carter - might you have been able to just ignore that message, or was it preventing you from doing things on the box somehow?
    – Codemonkey
    Commented Apr 15 at 11:40
0

You will be jumping through hoops for upgrades, just a question of where you want to spend time.

EL major version upgrades like that are not tested consistently. Especially for a moving target like CentOS Stream, and even more difficult if third party packages are also installed. In theory the package manager can handle an enormous distro wide upgrade transaction. In practice, RHEL invented a whole set of tooling to make the leap easy.

ELevate brings that tooling to the rest of EL. As of April 2024, upgrade to Stream 9 are planned but under development.

Or, you can try a slightly more risky dnf system-upgrade like in your question. Pay particular attention to what packages need to be removed to make the transaction happen. And diff config files to backups or expected values from clean install automation. Some review is prudent as major versions of software are changing.

Failing an in place upgrade, yes you can clean install a new host. Annoying that this could be the easier option, but it will work.

1
  • Well, I tried it, on the least important of my 3 production boxes. One I was considering cancelling for business reasons anyway. It didn't go well, I've now given up and terminated that box. Suppose I will have to bite the bullet and configure two new boxes for the other ones. Unless ELevate releases something imminently!
    – Codemonkey
    Commented 19 hours ago
0

In-place upgrade seems working, but rather hacky. Some of this is likely installation-specific, the below is intended for a small HPC cluster nodes behind a firewall. Adjust to your needs, scripts and clush greatly help. I added some reasoning to make the customization easier.

  1. Get the Centos 9 Stream repos.
dnf install -y \
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-26.el9.noarch.rpm \
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-26.el9.noarch.rpm \
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-26.el9.noarch.rpm
  1. Remove stuff which breaks the upgrade.
dnf remove iptables-ebtables-1.8.5-11.el8.x86_64 -y
dnf config-manager --disable raven*
dnf remove epel-release* -y
  1. Upgrade most of the packages.
dnf -y --releasever=9-stream --allowerasing --setopt=deltarpm=false distro-sync
rpmdb --rebuilddb
dnf clean packages -y
  1. Install EPEL for Centos 9 Stream.
dnf config-manager --set-enabled crb -y
dnf install epel-release epel-next-release -y
  1. Remove more broken stuff.
dnf remove arpack -y
dnf module reset  javapackages-tools llvm-toolset llvm-toolset-next perl perl-IO-Socket-SSL perl-libwww-perl python27 python36 python39 -
  1. Make sure a minimal system is installed.
dnf distrosync -y
dnf -y groupupdate "Core" "Minimal Install"
  1. Install NIS from previously downloaded Fedora38 packages. They decided none needs these anymore :)
dnf install /opt/yp/nss_nis-3.1-13.fc38.x86_64.rpm \
/opt/yp/ypbind-2.7.2-10.fc38.x86_64.rpm \
/opt/yp/yp-tools-4.2.3-14.fc38.x86_64.rpm  -y
echo "domain <DOMAIN> server <NIS SERVER IP>" >> /etc/yp.conf
systemctl enable ypbind.service && systemctl start ypbind.service
  1. Make sure the machine sets its hostname from DHCP/DNS/..
rm -f /etc/hostname && systemctl restart NetworkManager
  1. Remove their firewall. (These are all machines on an internal network.)
systemctl disable firewalld && systemctl stop firewalld && systemctl mask firewalld
  1. Remove the subscription manager they forgot to remove from Centos.
dnf remove subscription-manager -y
  1. Install any packages removed in the upgrade.
dnf install python3-root -y
  1. Reboot and enjoy Centos9.
3
  • Care to explain why this is a better option to try than the three-liner posed in my original question? Thank you!
    – Codemonkey
    Commented 2 days ago
  • I didnt get that work, and had to follow the rather cumbersome steps I posted. I guess it depends on the packages you have installed.
    – ondrejch
    Commented yesterday
  • The 3 lines I originally posted have mostly worked without issue for me. Messages on screen and in logs seem to suggest the upgrade has "worked", but /etc/redhat-release still shows CentOS Stream release 8, not 9. I wonder if I'm being really dumb, and there's a final step that I'm missing that I need to do - I've never tried upgrading between major versions with dnf before - any ideas? Thank you!
    – Codemonkey
    Commented 23 hours ago

You must log in to answer this question.

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