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. You have enabled Simple Content Access (SCA). Red Hat accounts created after July 15, 2022 have SCA enabled by default. Procedure Back up your system and verify that it can be restored if needed. Check Known issues and limitations and verify that your system is supported for conversion. Apply workarounds where applicable. 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. 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: https://cdn.redhat.com https://cdn-public.redhat.com https://subscription.rhsm.redhat.com - required only for systems with firewalls https://*.akamaiedge.net - required only for systems with firewalls https://cert.console.redhat.com If converting from CentOS Linux, update the CentOS repository URLs: Important CentOS Linux 7 and CentOS Linux 8 have reached end of life. For more information, see CentOS Linux EOL . Install Convert2RHEL : Download the Red Hat GPG key: Install the Convert2RHEL repository file. For conversions to RHEL 7, enter the following command: For conversions to RHEL 8, enter the following command: For conversions to RHEL 9, enter the following command: 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. Install the Convert2RHEL utility: Ensure you have access to RHEL packages through one of the following methods: 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. 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. Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 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 and RHEL 9 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 these repositories, see Considerations in adopting RHEL 8 and Considerations in adopting RHEL 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 . 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: 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. Temporarily disable antivirus software to prevent the conversion from failing. If you are accessing RHEL packages by using custom repositories, disable these repositories. The Convert2RHEL utility enables the custom repositories during the conversion process. 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 You have completed the steps listed in Preparing for a RHEL conversion . Procedure On your Alma Linux, CentOS Linux, Oracle Linux, or Rocky Linux system, run the pre-conversion analysis: 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. If you are converting to RHEL 7 and have an Extended Life Cycle Support (ELS) add-on, add the --els option. It is recommended to purchase an ELS add-on if you plan to stay on RHEL 7 to continue receiving support. 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: 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 Start the Convert2RHEL utility: To display all available options, use the --help ( -h ) option. If you are converting by using custom repositories instead of RHSM, add the --no-rhsm and 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. If you are converting to RHEL 7 and have an Extended Life Cycle Support (ELS) add-on, add the --els option. It is recommended to purchase an ELS add-on if you plan to stay on RHEL 7 to continue receiving support. Before Convert2RHEL starts replacing packages from the original distribution with RHEL packages, the following warning message is displayed: Changes made by Convert2RHEL up to this point can be automatically reverted. Confirm that you wish to proceed with the conversion process. Wait until Convert2RHEL installs the RHEL packages and finishes successfully. 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? . 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. Optional: Remove any remaining Convert2RHEL packages, files, and repositories: Remove the Convert2RHEL package: Remove Convert2RHEL files and repositories: 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: Replace RHEL_RepoID with your repository. If you have converted a system in Amazon Web Services (AWS) or Microsoft Azure with the Red Hat Enterprise Linux for Third Party Linux Migration with ELS offering, enable host metering on the system. For more information, see Enabling metering for Red Hat Enterprise Linux with Extended Lifecycle Support in your cloud environment . Optional: If you converted to RHEL 7 or RHEL 8, 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 .

Commands:
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-*
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txt
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repo
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-8-x86_64.repo
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-9-x86_64.repo
yum -y install convert2rhel
[subscription_manager] org = <organization_ID> activation_key = <activation_key>
convert2rhel analyze
========== 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]
convert2rhel
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.
reboot
yum remove -y convert2rhel
rm -f /etc/convert2rhel.ini.rpmsave rm -f /etc/yum.repos.d/convert2rhel.repo
yum list extras --disablerepo="*" --enablerepo= <RHEL_RepoID>