Skip to Content
Bash Script GuidesOracle Linux 8 to Rocky Linux from CIQ

Oracle Linux 8 to Rocky Linux from CIQ

Overview

migrate2rlc.sh converts Oracle Linux 8 systems to Rocky Linux from CIQ (RLC) using the CIQ Depot. Oracle Linux 8 requires additional handling compared to other EL8 distributions: UEK kernel force-removal, Oracle-specific repo cleanup, and GRUB boot entry repair after the UEK kernel is gone.

The script auto-detects Oracle Linux 8 and routes into the correct migration path. No manual OS identification flags are needed.

Prerequisites

  • Oracle Linux 8.x (any minor version) with internet access
  • Root or sudo privileges
  • CIQ Depot credentials (username and token)
  • At least 2 GB free disk space
  • A maintenance window (reboot required)
  • Backups of any critical data

Migration Command

./migrate2rlc.sh -r -t rlc-pro -u <depot-username> -p <depot-token>

Supported tiers: rlc-pro, rlc-plus, rlc-96-lts

The -r flag triggers an automatic reboot after migration completes. Omit it to reboot manually.

What Happens During Migration

  1. Pre-flight checks: validates system, checks disk space, detects third-party repos
  2. Edge case detection: identifies Oracle-specific packages and configurations
  3. UEK kernel removal: force-removes Oracle's Unbreakable Enterprise Kernel via rpm --nodeps
  4. Oracle repo cleanup: disables or removes UELN, developer, and addons repositories
  5. Package swap: replaces oraclelinux-release and related packages with Rocky equivalents
  6. Depot enrollment: installs depot CLI, authenticates, enables the selected tier product
  7. distro-sync: synchronizes all packages to the RLC repository versions
  8. GRUB repair: updates saved_entry to point to the Rocky kernel BLS entry
  9. Post-migration update: reinstalls CIQ kernel, verifies services, generates summary
  10. Reboot: boots into Rocky kernel with CIQ packages

Oracle Linux 8 Specific Notes

UEK Kernel Force-Removal

Oracle's UEK kernel packages have complex dependency chains that prevent clean removal via dnf remove. The script uses rpm -e --nodeps to forcibly remove all UEK-related packages before the package swap. This is safe because the standard RHCK (Red Hat Compatible Kernel) or the incoming Rocky kernel replaces it.

Oracle Repository Handling

The script detects and disables all Oracle-specific repositories:

  • ol8_UELN (Unbreakable Linux Network)
  • ol8_developer, ol8_developer_EPEL
  • ol8_addons
  • Any other ol8_* prefixed repositories

Third-party repos (EPEL, Docker CE, etc.) are temporarily disabled during migration and re-enabled afterward.

GRUB saved_entry Fix

After UEK removal, the GRUB environment's saved_entry still points to the now-missing UEK kernel. The fix_grub_default() function:

  1. Reads the current saved_entry from /boot/grub2/grubenv
  2. Identifies the correct Rocky kernel BLS entry ID ({machine-id}-{kernel-version})
  3. Updates saved_entry to the Rocky entry
  4. Removes stale BLS entries from /boot/loader/entries/
  5. Regenerates grub.cfg

Without this fix, the system fails to boot post-migration because GRUB cannot find the referenced kernel entry.

aarch64 Notes

Oracle Linux boot ISOs lack an install tree, and Oracle repos lack .treeinfo for aarch64 kickstart installs. For aarch64 testing, use Oracle's pre-built KVM qcow2 images from https://yum.oracle.com/oracle-linux-templates.html with virt-customize for root password and virt-install --import. UEK boots fine on KVM aarch64 with pre-built images.

Post-Migration Verification

After reboot, confirm the migration succeeded:

cat /etc/os-release rpm -q rocky-release ciq-rocky-gpg-keys depot list uname -r

The kernel should show a CIQ build suffix. All depot products for your tier should appear as enabled.

Run the verification script for a comprehensive check:

./verify_migration.sh

Tier Changes

To change tiers after initial migration (e.g., from Pro to Plus):

./migrate2rlc.sh -r -t rlc-plus -u <depot-username> -p <depot-token>

The script detects the existing RLC installation and performs a tier change instead of a full migration. All six tier permutations are supported. Note: EL8 does not have tier-specific release packages (no rlc-pro-release on EL8).

Troubleshooting

System fails to boot after migration

Check GRUB configuration from rescue mode. Verify that saved_entry in /boot/grub2/grubenv references a valid BLS entry in /boot/loader/entries/.

UEK packages remain after migration

Run rpm -qa | grep uek to identify leftover packages. Remove them manually with rpm -e --nodeps <package>, then run dnf distro-sync to ensure consistency.

Oracle repos reappear after dnf operations

The oraclelinux-release package may recreate repo files on update. Verify the package was fully replaced: rpm -q oraclelinux-release should return "not installed."

Third-party repos disabled after migration

The script re-enables third-party repos post-migration. If any remain disabled, check /etc/yum.repos.d/ for .disabled suffixed files and rename them back.


DISCLAIMER

The migrate2rlc script and playbook are provided "as is" without warranty of any kind, express or implied. Use of these tools is entirely at your own risk. CIQ, Inc. assumes no responsibility or liability for any data loss, system downtime, service disruption, or other damage resulting from the use or misuse of these tools. It is the user's responsibility to ensure adequate backups and testing in a non-production environment before performing any migration on production systems.