Upgrade Rocky Linux 8 to 9 CLI

linux9rockyrpmupgrade8

I thought I would share my version of how I updated the server that runs this blog from Rocky 8 to Rocky 9 without a clean install. I want to mention this is a do at your own risk post, this is not officially supported.

!!!Do not attempt this if you do not have backups and a way to fully recover your system.!!!

The first step I took was go to the rocky download site and make sure I grabbed the latest GPG, RELEASE and REPOS: https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/ You will need to modify the below command to match the version you find in the above site, once that is complete you can run it.

[root@rocky-us-east-jasonralph ~]# dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/{rocky-gpg-keys-9.2-1.4.el9.noarch.rpm,rocky-release-9.2-1.4.el9.noarch.rpm,rocky-repos-9.2-1.4.el9.noarch.rpm}

One road block was dnf did not like that I had remi and epel release 8, so I removed them and it went fine.

[root@rocky-us-east-jasonralph ~]# dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/{rocky-gpg-keys-9.2-1.4.el9.noarch.rpm,rocky-release-9.2-1.4.el9.noarch.rpm,rocky-repos-9.2-1.4.el9.noarch.rpm}
Last metadata expiration check: 0:20:38 ago on Thu 18 May 2023 10:27:24 PM UTC.
rocky-gpg-keys-9.2-1.4.el9.noarch.rpm                                                                                                                                                                                                   169 kB/s |  12 kB     00:00    
rocky-release-9.2-1.4.el9.noarch.rpm                                                                                                                                                                                                    403 kB/s |  23 kB     00:00    
rocky-repos-9.2-1.4.el9.noarch.rpm                                                                                                                                                                                                      298 kB/s |  12 kB     00:00    
Error: 
 Problem: problem with installed package remi-release-8.7-2.el8.remi.noarch
  - package remi-release-8.7-2.el8.remi.noarch requires system-release(releasever) = 8, but none of the providers can be installed
  - package remi-release-8.4-1.el8.remi.noarch requires system-release(releasever) = 8, but none of the providers can be installed
  - package remi-release-8.5-2.el8.remi.noarch requires system-release(releasever) = 8, but none of the providers can be installed
  - package remi-release-8.5-3.el8.remi.noarch requires system-release(releasever) = 8, but none of the providers can be installed
  - package remi-release-8.6-1.el8.remi.noarch requires system-release(releasever) = 8, but none of the providers can be installed
  - cannot install both rocky-release-9.2-1.4.el9.noarch and rocky-release-8.7-1.2.el8.noarch
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Find the epel and remi release rpms:

[root@rocky-us-east-jasonralph ~]# rpm -qa| grep release
remi-release-8.7-2.el8.remi.noarch
epel-release-8-19.el8.noarch
rocky-release-8.7-1.2.el8.noarch

Remove them:

[root@rocky-us-east-jasonralph ~]# yum remove epel-release-8-19.el8.noarch remi-release-8.7-2.el8.remi.noarch

Upgrade your system to 9 from 8:

[root@rocky-us-east-jasonralph ~]# dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/{rocky-gpg-keys-9.2-1.4.el9.noarch.rpm,rocky-release-9.2-1.4.el9.noarch.rpm,rocky-repos-9.2-1.4.el9.noarch.rpm}

I ignored this error, it seems like its just a GPG error:

  Running scriptlet: rocky-gpg-keys-8.7-1.2.el8.noarch                                                                                                                                                                                                              6/6 
Line is not an assignment at '/usr/lib/sysctl.d/50-redhat.conf:8': (null)
Couldn't write '1' to 'net/ipv4/conf/*/rp_filter', ignoring: No such file or directory
warning: %transfiletriggerin(systemd-239-68.el8_7.4.x86_64) scriptlet failed, exit status 1

Error in  scriptlet in rpm package rocky-gpg-keys

Verify:

[root@rocky-us-east-jasonralph ~]# cat /etc/rocky-release
Rocky Linux release 9.2 (Blue Onyx)

Rebuild the RPM database to now use SQLITE:

[root@rocky-us-east-jasonralph ~]# rpm --rebuilddb

Thats it, reboot:

[root@rocky-us-east-jasonralph ~]# reboot

I did have some issues with dnf where I needed to reset some modules.

[root@rocky-us-east-jasonralph ~]#  dnf check
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(platform:el8) needed by module httpd:2.4:8070020230406163027:3b9f49c4.x86_64
 Problem 2: conflicting requests
  - nothing provides module(platform:el8) needed by module mariadb:10.3:8060020220913075833:d63f516d.x86_64
 Problem 3: conflicting requests
  - nothing provides module(platform:el8) needed by module mysql:8.0:8060020221025174942:d63f516d.x86_64
 Problem 4: conflicting requests
  - nothing provides module(platform:el8) needed by module nginx:1.14:8040020210610090123:9f9e2e7e.x86_64

I needed to reset the modules one by one, there may be more on your system:

[root@rocky-us-east-jasonralph ~]# dnf module reset httpd:2.4 mariadb:10.3 mysql:8.0 nginx:1.14

That seemed to fix it, good luck.