How to Upgrade from Rocky Linux 8 to Rocky Linux 9?
Rocky Linux 9 is the successor to Rocky Linux 8, offering enhanced security, improved system performance, and updated software packages. This version supports modern hardware and includes new kernel features that optimize system management and automation. Upgrading your server to Rocky Linux 9 ensures you benefit from the latest security patches and features.
This guide walks you through the process of upgrading Rocky Linux 8 to Rocky Linux 9.
Prerequisites
Before beginning the upgrade, ensure you meet the following requirements:
A Rocky Linux 8 instance deployed on Vultr.
SSH access as a non-root user with sudo privileges.
At least 2GB of free disk space.
To check available disk space, run:
$ df –h
Your output should resemble:
Filesystem Size Used Avail Use% Mounted on udev 462M 0 462M 0% /dev tmpfs 96M 1.9M 94M 2% /run /dev/vda2 23G 5.1G 17G 23% / tmpfs 480M 0 480M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/vda1 511M 12M 500M 3% /boot/efi tmpfs 96M 0 96M 0% /run/user/0
Create a Full Server Backup
Upgrading may lead to incompatibilities or failures. To protect your data, create a backup snapshot by following these steps:
- Log in to the Vultr Customer Portal.
- Click Products > Compute.
- Select your Rocky Linux 8 instance.
- Go to the Snapshots tab and click Snapshots.
- Enter a label and click Take Snapshot.
Monitor progress until the status changes to Available.
If using a local server, use rsync or tar to create a backup before proceeding.
Check Application Compatibility
Before upgrading, verify that your installed applications are compatible with Rocky Linux 9:
Review the Rocky Linux 9 release notes for deprecated packages and known issues.
Confirm that software packages and dependencies support Rocky Linux 9.
Check third-party repositories like EPEL and RPM Fusion, and disable them if needed to prevent conflicts.
Prepare for the Upgrade
Update and clean up your current system:
$ sudo dnf update -y
$ sudo dnf upgrade --refresh
$ sudo dnf autoremove -y
$ sudo dnf clean all
Upgrade to Rocky Linux 9
Step 1: Install the Rocky Linux 9 Release and Repository Packages
Download and install the latest rocky-release, rocky-repos, and rocky-gpg-keys packages:
$ sudo dnf install http://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.4-1.7.el9.noarch.rpm \
http://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.4-1.7.el9.noarch.rpm \
Step 2: Remove Conflicting Packages
To prevent installation conflicts, remove the following packages:
$ sudo dnf -y remove rpmconf yum-utils epel-release $ sudo rm -rf /usr/share/redhat-logos
Step 3: Perform the Upgrade
Upgrade the system by running:
$ sudo dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync
Step 4: Rebuild the RPM Database
$ sudo rpm –rebuilddb
Step 5: Reboot the Server
After the upgrade, reboot your system:
$ sudo reboot
Verify the Upgrade
To confirm that the upgrade was successful, check the OS version:
$ cat /etc/os-release
Expected output:
NAME="Rocky Linux" VERSION="9.4 (Blue Onyx)" ID="rocky" VERSION_ID="9.4" PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
Check internet connectivity:
$ ping -c 5 google.com
Troubleshooting
If issues arise, use these commands:
Identify conflicting modules:
$ sudo dnf repoquery –unsatisfied
Reset conflicting modules:
$ sudo dnf module reset module-name
List obsolete packages:
$ sudo dnf list obsoleted
Remove obsolete packages:
$ sudo dnf remove package-name
Check system logs:
$ sudo journalctl -p 3 –xb
If you see errors, edit the affected configuration files, then restart services:
$ sudo systemctl restart systemd-sysctl
Wrap Up
By following this guide, you have successfully upgraded your server from Rocky Linux 8 to Rocky Linux 9. This upgrade provides enhanced security, performance improvements, and long-term support, ensuring stability for your applications. Stay updated with official Rocky Linux documentation and community forums for ongoing support and best practices.