Chapter 4. Converting using the command-line

You can perform the conversion from Alma Linux, CentOS Linux, Oracle Linux, or Rocky Linux to RHEL by using the command-line interface.

4.1. Preparing for a RHEL conversion

This procedure describes the steps that are necessary before performing the conversion from Alma Linux, CentOS Linux, Oracle Linux, or Rocky Linux to Red Hat Enterprise Linux (RHEL).

Prerequisites

  • You have verified that your system is supported for conversion to RHEL. See Supported conversion paths for more information.
  • You have stopped important applications, database services, and any other services that store data to reduce the risk of data integrity issues.
  • You have temporarily disabled antivirus software to prevent the conversion from failing.
  • You have disabled or adequately reconfigured any configuration management system, such as Salt, Chef, Puppet, Ansible, to not attempt to restore the original system.
  • The sos package is installed. You must use this package to generate an sosreport that is required when opening a support case for the Red Hat Support team.
  • You have created an activation key in Satellite or RHSM. For more information, see Managing activation keys in Satellite documentation and Getting started with activation keys on the Hybrid Cloud Console in RHSM documentation.

Procedure

  1. Back up your system and verify that it can be restored if needed.
  2. Check Known issues and limitations and verify that your system is supported for conversion. Apply workarounds where applicable.
  3. Ensure that the standard kernel is the booted kernel:

    • Alma Linux: the standard Alma Linux Kernel
    • CentOS Linux: the standard CentOS Linux kernel
    • Oracle Linux: the Red Hat Compatible Kernel (RHCK)
    • Rocky Linux: the standard Rocky Linux Kernel

      If the kernel your system is booted into is not the standard kernel, for example CentOS realtime kernel or Oracle Linux Unbreakable Enterprise Kernel (UEK), change the default kernel to the standard kernel and reboot your system to apply the changes.

  4. If converting from CentOS Linux 8, remove any CentOS Stream packages from your system. CentOS Stream is not currently supported for conversion, and the conversion might fail if any packages are present on the system.
  5. If you are converting with a firewall, using Red Hat Satellite, or through a proxy server, ensure that you have access to the following connections:

  6. If converting from CentOS Linux 8, update the CentOS repository URLs:

    # sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
    # sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
    Important

    CentOS Linux 8 has reached end of life. For more information, see CentOS Linux EOL.

  7. Install Convert2RHEL:

    1. Download the Red Hat GPG key:

      # curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
    2. Install the Convert2RHEL repository file.

      1. For conversions to RHEL 7, enter the following command:

        # curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repo
      2. For conversions to RHEL 8, enter the following command:

        # curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-8-x86_64.repo
        Note

        You must perform the conversion with the latest version of the Convert2RHEL repository file. If you had previously installed an earlier version of the repository file, remove the earlier version and install the current version.

    3. Install the Convert2RHEL utility:

      # yum -y install convert2rhel
  8. Ensure you have access to RHEL packages through one of the following methods:

    1. Red Hat Content Delivery Network (CDN) through Red Hat Subscription Manager (RHSM). You must have a Red Hat account and an appropriate RHEL subscription to access RHSM. Note that the OS will be converted to the corresponding minor version of RHEL per Table 1.1.
    2. Red Hat Satellite in a version that has Full or Maintenance support. For more information, see Red Hat Satellite Product Life Cycle.

      Note

      Ensure that the Satellite server meets the following conditions:

      • Satellite has a subscription manifest with RHEL repositories imported. For more information, see the Managing Red Hat Subscriptions chapter in the Managing Content guide for the particular version of Red Hat Satellite, for example, for version 6.14.
      • All required repositories are enabled and synchronized with the latest target OS updates and published on Satellite. Enable at minimum the following repositories for the appropriate major version of the OS:

        • Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
        • Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs <target_os>
        • Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs <target_os>

      Replace target_os with 8.5 for CentOS Linux conversions and 8.9, 8.8, or 8.6 for Alma Linux, Oracle Linux, or Rocky Linux conversions.

    3. Custom repositories configured in the /etc/yum.repos.d/ directory and pointing to a mirror of the target OS repositories. Use custom repositories for systems that have access to only local networks or portable media and therefore cannot access Red Hat CDN through RHSM. Make sure that the repositories contain the latest content available for that RHEL minor version to prevent downgrading and potential conversion failures. For more information, see Creating a Local Repository and Sharing With Disconnected/Offline/Air-gapped Systems.

      Note

      RHEL 8 content is distributed through two default repositories, BaseOS and AppStream. If you are accessing RHEL packages through custom repositories, you must configure both default repositories for a successful conversion. When running the Convert2RHEL utility, make sure to enable both repositories using the --enablerepo option. For more information about RHEL 8 repositories, see Considerations in adopting RHEL 8.

  9. If you are accessing RHEL packages through a Red Hat Satellite server, register your system with Red Hat Satellite. For more information, see Registering Hosts and Setting Up Host Integration.
  10. If you are converting by using RHSM and have not yet registered the system, update the /etc/convert2rhel.ini file to include the following data:

    [subscription_manager]
    org = <organization_ID>
    activation_key = <activation_key>

    Replace organization_id and activation_key with the organization ID and activation key from the Red Hat Customer Portal if you are using Red Hat CDN.

  11. Temporarily disable antivirus software to prevent the conversion from failing.
  12. If you are accessing RHEL packages by using custom repositories, disable these repositories. The Convert2RHEL utility enables the custom repositories during the conversion process.
  13. Update the original OS to the minor version supported for conversion as specified in Table 1.1 and then reboot the system.

    You must perform the conversion with the latest packages from the minor version of the OS that is supported for conversion to use the rollback feature in case the conversion fails. For more information, see Conversion rollback.

4.2. Reviewing the pre-conversion analysis report

To assess whether your systems can be converted to RHEL, run the RHEL pre-conversion analysis. The pre-conversion analysis generates a report that summarizes potential problems and suggests recommended solutions. The report also helps you decide whether it is possible or advisable to proceed with the conversion to RHEL.

Always review the entire pre-conversion analysis report, even when the report finds no inhibitors to the conversion. The pre-conversion analysis report contains recommended actions to complete before the conversion to ensure that the converted RHEL system functions correctly.

Important

The pre-conversion analysis report cannot identify all inhibiting problems with your system. As a result, issues might still occur during the conversion even after you have reviewed and remediated all problems in the report.

Prerequisites

Procedure

  1. On your Alma Linux, CentOS Linux, Oracle Linux, or Rocky Linux system, run the pre-conversion analysis:

    #  convert2rhel analyze
    • If you are converting to RHEL 8.8 and have an Extended Upgrade Support (EUS), add the --eus option. This option ensures that your system receives important security updates delivered to EUS repositories only. Conversions to RHEL 8.6 use EUS repositories automatically.
  2. The pre-conversion analysis runs a series of tests to determine whether your system can be converted to RHEL. After the analysis is complete, review the status and details of each completed test in the pre-conversion report in the terminal. Non-successful tests contain a description of the issue, a diagnosis of the possible cause of the issue, and, if applicable, a recommended remediation.

    Each test results in one of the following statuses:

    • Success - The test was successful and there are no issues for this component.
    • Error - The test encountered an issue that would cause the conversion to fail because it is very likely to result in a deteriorated system state. This issue must be resolved before converting.
    • Overridable - The test encountered an issue that would cause the conversion to fail because it is very likely to result in a deteriorated system state. This issue must be either resolved or manually overridden before converting.
    • Warning - The test encountered an issue that might cause system and application issues after the conversion. However, this issue would not cause the conversion to fail.
    • Skip - Could not run this test because of a prerequisite test failing. Could cause the conversion to fail.
    • Info - Informational with no expected impact to the system or applications.

      For example:

      ========== Warning (Review and fix if needed) ==========
      
      (WARNING) PACKAGE_UPDATES::PACKAGE_NOT_UP_TO_DATE_MESSAGE - Outdated packages detected
           Description: Please refer to the diagnosis for further information
           Diagnosis: The system has 4 package(s) not updated based on the enabled system repositories.
          List of packages to update: openssh-server openssh openssh-clients.
      
          Not updating the packages may cause the conversion to fail.
          Consider updating the packages before proceeding with the conversion.
           Remediation: [No further information given]
  3. After reviewing the report and resolving all reported issues, repeat steps 1-2 to rerun the analysis and confirm that there are no issues outstanding.

4.3. Converting to a RHEL system

This procedure describes the steps necessary to convert your system from Alma Linux, CentOS Linux, Oracle Linux, or Rocky Linux to Red Hat Enterprise Linux (RHEL).

Procedure

  1. Start the Convert2RHEL utility:

    # convert2rhel
    • To display all available options, use the --help (-h) option.
    • If you are converting by using custom repositories instead of RHSM, add the --enablerepo <RHEL_RepoID1> --enablerepo <RHEL_RepoID2> options. Replace RHEL_RepoID with your custom repository configured in the /etc/yum.repos.d/ directory, for example, rhel-7-server-rpms or rhel-8-baseos and rhel-8-appstream.
    • If you are converting to RHEL 7, you can manually enable RHEL 7 Extras or Optional repositories by using the --enablerepo option to replace additional packages with their RHEL counterparts. Note that packages in the Optional repository are unsupported. For more information, see Support policy of the optional and supplementary channels in Red Hat Enterprise Linux.
    • If you are converting to RHEL 8.8 and have an Extended Upgrade Support (EUS), add the --eus option. This option ensures that your system receives important security updates delivered to EUS repositories only. Conversions to RHEL 8.6 use EUS repositories automatically.
  2. Before Convert2RHEL starts replacing packages from the original distribution with RHEL packages, the following warning message is displayed:

    The tool allows rollback of any action until this point.
    By continuing, all further changes on the system will need to be reverted manually by the user, if necessary.

    Changes made by Convert2RHEL up to this point can be automatically reverted. Confirm that you wish to proceed with the conversion process.

  3. Wait until Convert2RHEL installs the RHEL packages and finishes successfully.
  4. Recommended: If you used custom repositories for the conversion, register and subscribe your RHEL system. For more information, see How to register and subscribe a system offline to the Red Hat Customer Portal?.
  5. At this point, the system still runs with the original distribution kernel loaded in RAM. Reboot the system to boot the newly installed RHEL kernel.

    # reboot
  6. Review the list of the third-party packages and remove unnecessary packages from the original OS that remained unchanged. These are typically packages that do not have a RHEL counterpart. To get a list of these packages, use:

    # yum list extras --disablerepo="*" --enablerepo=<RHEL_RepoID>

    Replace RHEL_RepoID with your repository.

    Note

    On Alma Linux 8.8 systems, some Alma Linux packages are not replaced with RHEL packages. See Known issues and limitations for more information.

  7. Optional: Perform an in-place upgrade to RHEL 9 to ensure your system is updated with the latest enhancements, security features, and bug fixes. For more information, see the Upgrading from RHEL 7 to RHEL 8 and Upgrading from RHEL 8 to RHEL 9 guides. Note that if you have converted to RHEL 7, you must first perform the in-place upgrade from RHEL 7 to RHEL 8, and then from RHEL 8 to RHEL 9.

Verification

  • Verify that your system operates as expected. If necessary, reconfigure system services after the conversion and fix dependency errors. For more information, see Fixing dependency errors.