Questo contenuto non è disponibile nella lingua selezionata.
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.
4.1. Preparing for a RHEL conversion Copia collegamentoCollegamento copiato negli appunti!
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
sospackage is installed. You must use this package to generate ansosreportthat 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:
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-*
# 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-*Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantCentOS 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:
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txt
# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
Convert2RHELrepository file.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
# curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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
# curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-8-x86_64.repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow For conversions to RHEL 9, enter the following command:
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-9-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.repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou must perform the conversion with the latest version of the
Convert2RHELrepository file. If you had previously installed an earlier version of the repository file, remove the earlier version and install the current version.
Install the
Convert2RHELutility:yum -y install convert2rhel
# yum -y install convert2rhelCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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.
NoteEnsure 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.5for CentOS Linux conversions and8.10for 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 the Red Hat Knowledgebase solution Creating a Local Repository and Sharing With Disconnected/Offline/Air-gapped Systems.NoteRHEL 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
Convert2RHELutility, make sure to enable both repositories using the--enablerepooption. 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 to Red Hat Satellite by using an activation key with an associated Content View providing access to RHEL repositories. If your system does not have access to the original vendor repositories, make sure that the Content View provides access to both original vendor and RHEL repositories. If your system is already registered, you can change the Content View by following the How to change Life Cycle Environment and Content Views for Content Hosts using hammer command line and from Satellite Web UI? Knowledgebase article. For more information, see Managing Hosts.
If you are converting by using RHSM and have not yet registered the system, update the
/etc/convert2rhel.inifile to include the following data:[subscription_manager] org = <organization_ID> activation_key = <activation_key>
[subscription_manager] org = <organization_ID> activation_key = <activation_key>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
Convert2RHELutility 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 Copia collegamentoCollegamento copiato negli appunti!
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.
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:
convert2rhel analyze
# convert2rhel analyzeCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
If you are converting to RHEL 7 and have an Extended Life Cycle Support (ELS) add-on, add the
--elsoption. It is recommended to purchase an ELS add-on if you plan to stay on RHEL 7 to continue receiving support.
-
If you are converting to RHEL 7 and have an Extended Life Cycle Support (ELS) add-on, add the
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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 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 Copia collegamentoCollegamento copiato negli appunti!
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
Convert2RHELutility:convert2rhel
# convert2rhelCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
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-rpmsorrhel-8-baseosandrhel-8-appstream. -
If you are converting to RHEL 7, you can manually enable RHEL 7 Extras or Optional repositories by using the
--enablerepooption to replace additional packages with their RHEL counterparts. Note that packages in the Optional repository are unsupported. For more information, see the Red Hat Knowledgebase solution Support policy of the optional and supplementary channels in Red Hat Enterprise Linux. -
If you are converting to RHEL 7 and have an Extended Life Cycle Support (ELS) add-on, add the
--elsoption. It is recommended to purchase an ELS add-on if you plan to stay on RHEL 7 to continue receiving support.
-
To display all available options, use the
Before
Convert2RHELstarts 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.
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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Changes made by
Convert2RHELup to this point can be automatically reverted. Confirm that you wish to proceed with the conversion process.-
Wait until
Convert2RHELinstalls 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 the Red Hat Knowledgebase solution 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.
reboot
# rebootCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Remove any remaining Convert2RHEL packages, files, and repositories:
Remove the Convert2RHEL package:
yum remove -y convert2rhel
# yum remove -y convert2rhelCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove Convert2RHEL files and repositories:
rm -f /etc/convert2rhel.ini.rpmsave rm -f /etc/yum.repos.d/convert2rhel.repo
# rm -f /etc/convert2rhel.ini.rpmsave # rm -f /etc/yum.repos.d/convert2rhel.repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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>
# yum list extras --disablerepo="*" --enablerepo=<RHEL_RepoID>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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.