After June 30, 2024, Red Hat Enterprise Linux (RHEL) 7 transitioned from the Maintenance Support phase to the Extended Life phase. Red Hat provides limited technical support in the Extended Life phase. If your Elastic Compute Service (ECS) instances and applications are deployed on top of RHEL 7, we recommend that you upgrade RHEL 7 to RHEL 8 to use new service capabilities and remain compatible with the most recent hardware platforms and independent software vendor (ISV) software. This topic describes how to upgrade RHEL 7 to RHEL 8 on an ECS instance.
If your current business must be retained in RHEL 7, we recommend that you purchase an Alibaba Cloud RHEL Extended Life Cycle Support (ELS) Add-On subscription to receive continuous software maintenance and technical support in the ELS phase. For more information, see Red Hat Enterprise Linux 7 ELS guidance.
Prerequisites
The ECS instance that you want to upgrade meets the requirements for running RHEL 8. For more information, see Red Hat Enterprise Linux Technology Capabilities and Limits.
The ECS instance uses a RHEL 7 image that is purchased in Alibaba Cloud Marketplace and contains a RHEL 7 subscription or a RHEL 7 image that is imported to Alibaba Cloud and contains a separately purchased Alibaba Cloud RHEL 7 subscription.
NoteTo check whether your operating system has the Alibaba Cloud RHEL 7 subscription, run the
rpm -q client-rhel7
command. If the command output similar toclient-rhel7-3.0-1.el7_9.noarch
is returned, you purchased the Alibaba Cloud RHEL 7 subscription.If you purchased a Red Hat RHEL 7 subscription, see Upgrading from RHEL 7 to RHEL 8 at the official Red Hat website.
Procedure
The upgrade operation can create risks. Before you perform the upgrade, we recommend that you create snapshots for disks on the instance to back up important data and familiarize yourself with the upgrade process and issues that may occur during the process. Exercise caution when you perform the upgrade. For information about how to create snapshots for disks, see Create a snapshot for a disk.
Connect to the ECS instance that runs a RHEL 7 operating system as the root user.
For more information, see Connect to a Linux instance by using a password or key.
Prepare the RHEL 7 operating system for the upgrade.
Run the following commands to update the RHEL 7 operating system to the latest minor version and restart the instance for the update to take effect:
yum -y update reboot
Run the following command to install the Leapp utility on the RHEL 7 operating system:
yum -y install leapp leapp-rhui-alibaba --enablerepo="*"
Perform a pre-upgrade check.
You must use the Leapp utility to perform a pre-upgrade check because RHEL 7 significantly differs from RHEL 8. You can view the Leapp check results and modify the configurations based on suggestions to meet upgrade requirements.
Run the following command to perform a pre-upgrade check. By default, RHEL 7 is upgraded to the latest version of RHEL 8.
leapp preupgrade --no-rhsm
NoteYou can also specify a RHEL 8 version. For example, to upgrade to RHEL 8.8, run the
leapp preupgrade --no-rhsm --target 8.8
command.To view the RHEL 8 versions that are supported, run the
leapp preupgrade -h
command.
View the pre-upgrade check results.
Leapp pre-upgrade check logs are stored in the following log files:
/var/log/leapp/leapp-preupgrade.log: stores the logs of the Leapp utility.
/var/log/leapp/leapp-report.txt: stores the pre-upgrade check report in the text format.
/var/log/leapp/leapp-report.json: stores the pre-upgrade check report in the JSON format.
If the pre-upgrade check fails, specific failed items (inhibitors) are displayed as shown in the following figure.
Resolve the issues that are reported in the pre-upgrade report.
Analyze the pre-upgrade check report in the
/var/log/leapp/leapp-report.txt
file. Resolve all reported issues by following the remediation suggestions that are provided by the Leapp utility. The following section describes several common issues that are reported in pre-upgrade check reports and how to resolve the issues:
Run the following command to upgrade RHEL 7. By default, RHEL 7 is upgraded to the latest version of RHEL 8.
leapp upgrade --no-rhsm
NoteYou can also specify a RHEL 8 version. For example, to upgrade to RHEL 8.8, run the
leapp upgrade --no-rhsm --target 8.8
command.The following command output indicates that the upgrade is complete.
Run the following command to restart the instance:
reboot
Check the post-upgrade status of the RHEL 8 operating system.
Check the upgrade logs or report.
In the RHEL 8 operating system, you can view the upgrade logs in the
/var/log/leapp/leapp-upgrade.txt
file or the upgrade report in the/var/log/leapp/leapp-report.txt
file to obtain the details of the upgrade process.The following log information indicates that specific software packages may fail to be installed or upgraded. You can manually install the software packages after the upgrade.
Risk Factor: high Title: Packages from unknown repositories may not be installed Summary: 3 packages may not be installed or upgraded due to repositories unknown to leapp: - python3-pyxattr (repoid: rhel8-CRB) - rpcgen (repoid: rhel8-CRB) - ustr (repoid: rhel8-CRB) Remediation: [hint] In case the listed repositories are mirrors of official repositories for RHEL (provided by Red Hat on CDN) and their repositories IDs has been customized, you can change the configuration to use the official IDs instead of fixing the problem. You can also review the projected DNF upgrade transaction result in the logs to see what is going to happen, as this does not necessarily mean that the listed packages will not be upgraded. You can also install any missing packages after the in-place upgrade manually.
The following log information indicates that specific RHEL 7 packages are not upgraded. You can remove the packages to retain the operating system in the supported status.
Risk Factor: high Title: Some RHEL 7 packages have not been upgraded Summary: Following RHEL 7 packages have not been upgraded: leapp-upgrade-el7toel8-0.18.0-1.el7_9 kernel-3.10.0-1160.92.1.el7 leapp-rhui-alibaba-1.0.0-1.el7_9 Please remove these packages to keep your system in supported state.
Run the
yum remove leapp-upgrade-el7toel8-0.18.0-1.el7_9 kernel-3.10.0-1160.92.1.el7 leapp-rhui-alibaba-1.0.0-1.el7_9
command to remove the packages.
Check whether your business runs as expected on RHEL 8.
(Conditionally required) Run the following commands to configure the software repository of RHEL 8.
After you perform the upgrade, the
/etc/dnf/vars/releasever
file is modified by default to specify a RHEL 8 version that you used in the preceding steps. For example, the RHEL 8.8 software repository address is set tohttps://xxxx/8.8/xxx
, and you can only access the RHEL 8.8 software packages. If you want to have automatic access to packages of the latest minor version of RHEL 8 such as RHEL 8.10, you can delete the releasever configuration file and rebuild the metadata cache. This way, you can obtain the latest security patches and feature updates.rm -f /etc/dnf/vars/releasever dnf clean all && dnf makecache
After the execution is complete, the software repository address is updated to
https://xxxx/8/xxx
, and you can obtain the latest version of the RHEL 8 packages.
References
For information about RHEL, see Red Hat Enterprise Linux.
For information about the RHEL 7 ELS phase, see the official FAQ released by Red Hat.