All CentOS versions have reached EOL. Assess risks to your ECS instances and migrate to a supported operating system.
Impact of CentOS EOL
As of June 30, 2024, CentOS has reached end-of-life (EOL). Continued use poses a security risk. Existing ECS instances can still run, but they will no longer receive software maintenance or support, including bug fixes and feature updates.
|
Version |
Release date |
EOL date |
Recommended action |
|
CentOS 8 |
2019-09-24 |
2021-12-31 |
Migrate immediately |
|
CentOS 7 |
2014-07-07 |
2024-06-30 |
Migrate immediately |
|
CentOS 6 |
2011-11-27 |
2020-11-30 |
Migrate immediately |
|
CentOS 5 |
2007-04-12 |
2017-03-31 |
Migrate immediately |
Post-EOL recommendations
Your response depends on your business situation. For internet-facing services or workloads requiring high stability and security, assess the risks and create a migration plan:
-
For new workloads: Use a CentOS-compatible operating system in its mainstream support phase. Do not create new ECS instances from EOL CentOS images.
-
For existing workloads: Start planning a migration immediately. Options include replacing the operating system or performing an operating system migration.
Replace or upgrade the operating system
Step 1: Choose a target operating system
Choose a Linux operating system to replace CentOS based on security, compliance, stability, compatibility, budget, and your long-term strategy.
Step 2: Prepare for migration
Before you begin, complete these preparations:
-
Application testing: Create a test environment with the target OS. Deploy your applications and test for functionality, performance, and compatibility.
-
Migration drill: Practice your migration plan in a non-production environment to identify potential issues. See Troubleshooting Linux operating system migration issues.
-
Plan the migration window: The instance restarts multiple times during migration and services are unavailable. Assess the impact and schedule accordingly.
Step 3: Perform the operating system migration
Before you start, manually create a snapshot of the instance's system disk and all data disks to prevent data loss. A migration fails if a snapshot is being created. Wait for all snapshots to finish before you begin.
|
Solution |
Scenarios |
Impacts |
Procedure |
|
In-place migration |
Complex application environments that are difficult to redeploy. You need to keep all data and configurations on the system disk. |
|
Available only for binary-compatible operating systems:
|
|
Replace the system disk |
You want to keep the instance configuration (such as IP address and instance ID), and your application can be redeployed. |
|
Replace the operating system (system disk), redeploy your application, and switch traffic after validation. Back up data from the original instance before switching. |
|
Redeploy the environment |
Zero-downtime requirement with seamless traffic switchover. |
You are responsible for migrating data and traffic and for the costs of the new instance. |
Create a new instance, redeploy your application, verify your business, then switch traffic and stop the original instance. |
FAQ
Target operating systems for CentOS
Operating systems that are binary-compatible with CentOS
A binary-compatible OS lets you run existing applications without recompilation. This applies to API compatibility, not bug-for-bug compatibility. For issues, consult the target OS support documentation.
|
Operating system |
Description |
Pricing |
Technical support |
|
Provided by Alibaba Cloud, fully compatible with RHEL/CentOS, optimized for the Alibaba Cloud environment. Includes free long-term support and maintenance. |
No |
Alibaba Cloud support |
|
|
Provided by the OpenAnolis community. 100% compatible with CentOS 8 and other major Linux distributions. A fully open source, enterprise-grade distribution with strong performance, stability, and security. |
No |
Alibaba Cloud support |
|
|
An enterprise OS from Red Hat. Requires a paid subscription for usage and support. |
A license fee is charged for the OS image. See Red Hat. |
Joint support from Alibaba Cloud and Red Hat |
|
|
A rolling-release distribution from the official CentOS project. |
No |
Community support |
|
|
A community-driven, enterprise-grade OS compatible with RHEL. Serves as a CentOS replacement. |
No |
Community support |
|
|
A community fork of CentOS by the CloudLinux team. 1:1 binary compatible with RHEL, supporting zero-downtime OS replacement. |
No |
Community support |
Other operating systems
|
Operating system |
Description |
Pricing |
Technical support |
|
An enterprise OS from SUSE, optimized for performance, security, and reliability. |
A license fee is charged for the OS image. See SUSE. |
Joint support from Alibaba Cloud and SUSE |
|
|
A Linux distribution by Canonical. Supports optional graphical desktop environments. |
No |
Community support |
|
|
A Linux distribution known for stability, security, and commitment to free software. |
No |
Community support |
|
|
A Linux-based OS developed and maintained by the OpenSUSE community with sponsorship from SUSE. |
No |
Community support |
Convert CentOS 7 to RHEL 7
Convert CentOS 7 to RHEL 7 by running commands on an instance. The operating system migration feature can automate this conversion.
Before you begin, stop critical applications and database services, and manually create a snapshot to prevent data loss.
-
(Conditional) If your ECS instance has Security Center installed, uninstall the Security Center client first.
Security Center is the default security tool for CentOS, whereas RHEL 7 uses Red Hat security tools. Incompatibilities may exist between them.
-
Download the Alibaba Cloud repository files.
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo sudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo -
Update system packages and restart.
sudo yum -y update sudo reboot -
Download and install convert2rhel from the official Red Hat website.
sudo curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txt sudo curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repo sudo yum -y install convert2rhel -
Purchase a software license for the ECS instance on Alibaba Cloud.
Activate the license before downloading RHEL packages.
-
Convert CentOS 7 to RHEL 7.
sudo convert2rhel -y --no-rhsm --enablerepo rhui-rhel-7-server-rhui-rpms --enablerepo rhui-rhel-7-server-rhui-extras-rpms --enablerepo rhui-rhel-7-server-rhui-optional-rpmsThe conversion takes time. Output similar to the following indicates completion.

-
Restart the system.
After the conversion, restart to boot with the new RHEL kernel. Then run
cat /etc/redhat-releaseto verify the conversion.sudo reboot -
Calibrate the operating system of the instance.
After the conversion, the Operating System on the instance details page may differ from the actual OS (Red Hat Enterprise Linux Server release 7.9). The displayed OS reflects the original image. Calibrate the operating system to update it.
Switch repository addresses for CentOS 6
The official CentOS 6 repository at http://mirror.centos.org/centos-6/ has been removed. Most third-party mirrors, including Alibaba Cloud repositories at http://mirrors.cloud.aliyuncs.com and http://mirrors.aliyun.com, no longer host CentOS 6 packages. Using the default repository configuration produces the following error:
Solution
This procedure applies to ECS instances. For non-ECS servers with public internet access, replace http://mirrors.cloud.aliyuncs.com with http://mirrors.aliyun.com in the repository URLs. For example, use http://mirrors.aliyun.com/centos-vault/6.10/ for yum and http://mirrors.aliyun.com/epel-archive/6/ for epel.
-
Log on to the ECS instance.
-
Go to the ECS console - Instances page. Select the region and resource group of your instance.
-
On the instance details page, click Connect, select Workbench, and log on to the terminal.
-
-
Switch the yum repository.
sudo vim /etc/yum.repos.d/CentOS-Base.repoPress i to enter edit mode and replace the content with the following.
[base] name=CentOS-6.10 enabled=1 failovermethod=priority baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6 [updates] name=CentOS-6.10 enabled=1 failovermethod=priority baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6 [extras] name=CentOS-6.10 enabled=1 failovermethod=priority baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6Press Esc, enter
:wq, and press Enter to save and exit. -
Switch the epel repository.
sudo vim /etc/yum.repos.d/epel.repoPress i to enter edit mode and replace the content with the following.
[epel] name=Extra Packages for Enterprise Linux 6 - $basearch enabled=1 failovermethod=priority baseurl=http://mirrors.cloud.aliyuncs.com/epel-archive/6/$basearch gpgcheck=0 gpgkey=http://mirrors.cloud.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6Press Esc, enter
:wq, and press Enter to save and exit. -
Run
yum repolist. If the repositories are listed without a 404 error, the switch was successful.
Preserve repository configuration in a custom image
When you create an ECS instance from a custom image, cloud-init automatically reinitializes the repository configuration on startup. To preserve a modified repository configuration, edit the cloud-init configuration file (/etc/cloud/cloud.cfg) on the source instance before creating the image.
-
Edit the /etc/cloud/cloud.cfg file.
sudo vim /etc/cloud/cloud.cfg -
Press i to enter edit mode. Comment out the
- source-addressmodule undercloud_init_modules:with a#.The configuration should appear as follows:

-
Press Esc, enter
:wq, and press Enter to save and exit.
References
For an overview of operating system lifecycle stages and standard EOL solutions, see Operating system lifecycle overview.