Here is how to do an in-place upgrade using dnf
Install release, repo, and gpg key
At time of writing, 9.1 is the latest. In the future, you may need to browse the rocky repo and use the latest version.
dnf install https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.1-1.11.el9.noarch.rpm https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-repos-9.1-1.11.el9.noarch.rpm https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.1-1.11.el9.noarch.rpm
Run the upgrade
rm -rf /usr/share/redhat-logos
dnf --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync
rpm --rebuilddb
reboot
Kernel and openssl version
It’s sad to see Rocky still haven’t adopt kernel 6.x. Still, the new kernel and openssl offer performance improvements over previous versions.
[root@rock8 ~]# uname -a
Linux rock8.zoo.lo 5.14.0-162.18.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Mar 1 22:02:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@rock8 ~]# openssl version
OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)
Reset dnf modules
If you use dnf modules, you may need to reset them.
dnf module reset httpd php mysql nginx perl virt python36 python39 container-tools llvm-toolset perl-DBD-SQLite perl-DBI perl-IO-Socket-SSL perl-libwww-perl
Remove el8 packages
Next step removes all packages from EL8. Please carefully review the package list before you run rpm -e! Leaving them on the system may cause problem for package update in the future.
[root@rock9 ~]# rpm -qa | grep \.el8 | xargs rpm -e
References
https://www.starwindsoftware.com/blog/upgrade-from-rocky-linux-8-x-to-rocky-linux-9-0