Home

About Us

Advertisement

Contact Us

PRIVACY POLICY

  • Facebook
  • X
  • Instagram
  • Pinterest
  • WhatsApp
  • RSS Feed
  • TikTok
ALT

Maalavs Blog

Your Trusted Voice Across the World.

  • NEWS
  • Linux Tech Blogs
  • Windows Tech Blogs
  • VIRTUALIZATION Blogs
Search

Linux RHEL 8 to RHEL 9 Upgrade: Detailed Procedure and Explanation

This document outlines the step-by-step process of upgrading a RHEL 8 system to RHEL 9, including package removal, kernel configuration, and bootloader management.


Step 1: Identifying Installed RHEL 8 Packages

Before upgrading, identify and list all installed packages specific to RHEL 8.

rpm -qa | grep -e '\.el[78]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort

Explanation:

  • rpm -qa lists all installed RPM packages.
  • grep -e '\.el[78]' filters packages from RHEL 7 and RHEL 8.
  • grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' excludes system key and module-related packages.
  • sort arranges the output for easy review.

To count the number of RHEL 8-specific packages:

rpm -qa | grep -e '\.el[78]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort | wc -l

This will return the total count of relevant packages.


Step 2: Exporting Package List and Removing RHEL 8 Packages

Before removing, save the package list:

rpm -qa | grep -e '\.el[78]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort >> rhel8pkg.txt

This ensures that you have a backup reference of the packages being removed.

To remove these packages, execute:

dnf remove $(cat rhel8pkg.txt)

Explanation:

  • dnf remove uninstalls packages.
  • $(cat rhel8pkg.txt) feeds the package list into the command.

Step 3: Cleaning Up Upgrade-Related Files

Remove any residual upgrade files that might interfere with the upgrade:

rm -rf /var/log/leapp /root/tmp_leapp_py3 /var/lib/leapp

Explanation:

  • rm -rf forcefully deletes unnecessary files and logs generated by the leapp upgrade tool.

Step 4: Updating Kernel Boot Parameters

Modify kernel boot options to reflect necessary configurations:

BOOT_OPTIONS="$(tr -s "$IFS" '\n' </proc/cmdline | grep -ve '^BOOT_IMAGE=' -e '^initrd=' | tr '\n' ' ')"
echo $BOOT_OPTIONS > /etc/kernel/cmdline

Explanation:

  • tr -s "$IFS" '\n' </proc/cmdline converts the /proc/cmdline parameters into a newline-separated format.
  • grep -ve '^BOOT_IMAGE=' -e '^initrd=' removes specific boot and initrd parameters.
  • tr '\n' ' ' joins parameters back into a space-separated format.
  • echo $BOOT_OPTIONS > /etc/kernel/cmdline saves the updated boot options.

Step 5: Removing Old Rescue Kernel Entries

To ensure a clean boot setup:

rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue*

Explanation:

  • rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue* removes old rescue kernel images.

Rebuild the rescue kernel:

/usr/lib/kernel/install.d/51-dracut-rescue.install add "$(uname -r)" /boot "/boot/vmlinuz-$(uname -r)"

This regenerates a rescue kernel for the current kernel version.

Verify rescue kernel presence:

ls /boot/vmlinuz-*rescue* /boot/initramfs-*rescue*

If verification is needed:

lsinitrd /boot/initramfs-*rescue*.img | grep -qm1 "$(uname -r)/kernel/" && echo "OK" || echo "FAIL"

This checks if the current kernel is properly included in the rescue image.


Step 6: Confirming GRUB Boot Configuration

To review the GRUB bootloader settings:

grubby --info $(ls /boot/vmlinuz-*rescue*)

This will display boot parameters associated with the rescue kernel.


Step 7: Final System Reboot

Once all steps are complete, reboot the system:

reboot

This will apply the changes and boot into the upgraded RHEL 9 environment.


Conclusion

This document provides a structured approach to upgrading from RHEL 8 to RHEL 9, covering package removal, kernel boot parameter adjustments, and GRUB bootloader updates to ensure a smooth transition.

Featured Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025
  • Manchester United Announces Job Cuts Amid Financial Restructuring

    Manchester United Announces Job Cuts Amid Financial Restructuring

    February 26, 2025
  • Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    February 26, 2025

Search

Author Details

Madhan Gopalakrishnan

I am a passionate “tech blogger” with a knack for breaking down complex topics into simple insights or exploring the latest trends in AI With 5 years of experience in IT Infra implementation and maintenance, I love to share knowledge through in-depth articles and practical tips. When not writing, you can find my hobby “traveling to offbeat destinations”.

  • X
  • Instagram
  • TikTok
  • Facebook

Follow Us on

  • Facebook
  • X
  • Instagram
  • VK
  • Pinterest
  • Last.fm
  • TikTok
  • Telegram
  • WhatsApp
  • RSS Feed

Categories

  • Article (15)
  • NEWS (73)

Archives

  • February 2025 (88)

Tags

About Us

Maalavs Magazine

It is your hub for the latest news across all domains, from technology and business to travel and innovation. We bring insightful updates, expert opinions, and engaging content to keep you informed and ahead. Whether you’re a tech enthusiast, a business professional, or a curious reader, we’ve got something for you. Stay updated with Maalavs Magazine!

Latest Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025

Categories

  • Article (15)
  • NEWS (73)
  • Instagram
  • Facebook
  • LinkedIn
  • X
  • VK
  • TikTok

Proudly Powered by Maalavs | Maalavs Magazine

Scroll to Top