All Products
Search
Document Center

Elastic Compute Service:CentOS operating system

Last Updated:Dec 26, 2025

The CentOS operating system has reached its end of life (EOL). If you continue to use CentOS, your system will be exposed to new security vulnerabilities, may become a target for attacks, and could violate security compliance requirements. You should assess the risks to your ECS instances based on your business scenario and take action as soon as possible to ensure the long-term stability and security of your services.

Impacts of CentOS EOL

The CentOS operating system reached its end of life (EOL) on June 30, 2024. Continuing to use it poses a security risk. Existing Elastic Compute Service (ECS) instances can continue to run, but you will no longer receive software maintenance or support, such as bug fixes and feature updates.

Version

Release date

End of life (EOL) date

Recommended action

CentOS 8

2019-09-24

2021-12-31

Migrate now

CentOS 7

2014-07-07

2024-06-30

Migrate now

CentOS 6

2011-11-27

2020-11-30

Migrate now

CentOS 5

2007-04-12

2017-03-31

Migrate now

Recommendations after CentOS EOL

Your approach to the operating system's end of life (EOL) depends on your business needs. If your services are public-facing or require high stability and security, you must assess the risks of EOL and create a response plan promptly:

  • For new services: Use a CentOS-compatible operating system that is in its mainstream support phase. Do not create new ECS instances from CentOS images that have reached EOL.

  • For existing services: Start preparing to replace the operating system or perform an operating system migration immediately.

Replace or upgrade the operating system

Step 1: Select a destination operating system

Before you migrate, select a Linux operating system to replace CentOS. Consider factors such as security compliance, stability, operating system compatibility, budget, and long-term strategy.

Step 2: Preparations

Before you perform any migration or replacement, complete these preparations:

  • Application testing: Create a staging environment with the destination operating system. Deploy your applications and run comprehensive functional, performance, and compatibility tests. Ensure that all business logic works correctly in the new environment.

  • Migration drill: Practice your chosen migration plan in a non-production environment. This helps you become familiar with the procedure and identify potential issues. For more information about common errors, see Troubleshooting Linux operating system migration issues.

  • Plan a migration window: During the migration, the system kernel and software packages of the original instance are installed or updated. The instance will restart multiple times, and your services will be unavailable. You should assess the impact and plan a suitable migration window to avoid service disruptions.

Step 3: Migrate the operating system

Important

Before you start the migration, create snapshots for the system disk and all data disks of the instance to prevent data loss. If a snapshot is being created, the migration will fail. Wait for the snapshot creation to complete before you start the migration.

Solution

Scenarios

Impacts

Procedure

In-place migration

Complex business environments that are difficult to rebuild. You need to keep all data and configurations on the system disk.

  • System disk data is retained.

  • The ECS instance restarts during migration, and services will be unavailable.

In-place migration is only available for operating systems that are binary-compatible with CentOS:

  • To migrate from CentOS 7/8 to Alibaba Cloud Linux, Anolis OS, or Red Hat Enterprise Linux: Complete the migration in the ECS console. For more information, see Operating system migration.

  • To migrate from CentOS 7 to AlmaLinux: Log on to the ECS instance and complete the migration. For more information, see ELevating CentOS 7 to AlmaLinux.

  • To migrate from CentOS 7/8 to Rocky Linux 8/9: Log on to the ECS instance and complete the migration. For more information, see How to migrate to Rocky Linux from CentOS.

Replace the system disk

You want to keep the original instance configuration, such as the IP address and instance ID, and can redeploy the application.

  • The system disk is released and its data cannot be recovered.

  • The ECS instance restarts during migration, and services will be unavailable.

After you replace the operating system (system disk), you must redeploy your business environment. After you verify your services, you can switch your business over. Before the switch, you must back up data and collect information from the original instance.

Redeploy the environment

Your business cannot tolerate downtime and requires a smooth traffic switchover.

You must migrate data and traffic yourself and bear the cost of the new ECS instance.

Replace the original instance by creating a custom instance. After you create the new instance, you must redeploy your business environment. After you verify your services, you can switch the service traffic to the new instance and pause the original instance.

FAQ

Which operating systems can I migrate to from CentOS?

CentOS binary-compatible operating systems

When you redeploy business-related runtime environments after migrating from CentOS to a CentOS binary-compatible operating system, you can run applications and software that were compiled for the original operating system directly in the new operating system without recompiling code. Migration to a CentOS-compatible operating system does not guarantee bug compatibility. If a bug incompatibility issue occurs, refer to the community-supported documentation for the corresponding distribution to resolve the issue.

Operating system

Description

Charged

Technical support

Alibaba Cloud Linux

Alibaba Cloud Linux is provided by Alibaba Cloud and is fully compatible with RHEL/CentOS. This operating system is highly optimized for Alibaba Cloud and comes with free long-term support and maintenance from Alibaba Cloud.

No

Alibaba Cloud support

Anolis OS

Anolis OS is provided by the OpenAnolis community. It is 100% compatible with the CentOS 8 software ecosystem and also compatible with other mainstream Linux distributions. This operating system is a completely open source, neutral, and open distribution that delivers enterprise-grade high performance, stability, security, and reliability.

No

Alibaba Cloud support

Red Hat Enterprise Linux

This is an Enterprise Edition operating system provided by Red Hat. You must pay to use it and can enjoy Red Hat's subscription services.

Image operating system license fees are involved. For more information, see Red Hat.

Joint support from Alibaba Cloud and Red Hat

CentOS Stream

CentOS Stream is a rolling upgrade version provided by the CentOS community.

No

Community support

Rocky Linux

A community-based enterprise operating system that is compatible with RHEL and serves as a replacement for CentOS.

No

Community support

AlmaLinux

A CentOS community branch built by the CloudLinux team. It is 1:1 compatible with RHEL and supports replacing the operating system without downtime.

No

Community support

Other operating systems

Operating system

Description

Charged

Technical support

SUSE Linux Enterprise Server

SUSE Linux Enterprise Server is an operating system introduced by SUSE that can adapt to any environment and is specifically optimized for performance, security, and reliability.

Image operating system license fees are involved. For more information, see Image billing.

Joint support from Alibaba Cloud and SUSE

Ubuntu

A Linux distribution developed by Canonical. You can install a graphical desktop based on Ubuntu for ease of use.

No

Community support

Debian

Debian is a popular Linux operating system known for its stability, security, and free software principles.

No

Community support

OpenSUSE

An operating system based on the Linux kernel, developed and maintained by the OpenSUSE project community and sponsored by companies such as SUSE.

No

Community support

How do I convert CentOS 7 to Red Hat Enterprise Linux (RHEL) 7?

The following procedure requires you to log on to the instance and manually run commands to convert CentOS 7 to RHEL 7. We recommend that you use the operating system migration feature to convert CentOS 7 to RHEL 7. This saves you from performing complex manual steps.

Important

Before the conversion, stop important applications, database services, and storage services. Then, create snapshots to back up important data and prevent data loss or other errors.

  1. (Conditional) If your server is an Alibaba Cloud server and has Security Center installed, you must first uninstall the Security Center client.

    Security Center is the default security enhancement tool for CentOS, while RHEL 7 uses security enhancement tools provided by Red Hat. Security Center may have incompatibilities and conflicts with the tools in RHEL 7. Therefore, you must uninstall the Security Center client during the conversion process to ensure system stability and compatibility.
  2. Download the new 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
  3. Update the system packages and restart the system.

    sudo yum -y update
    sudo reboot
  4. Download and install the convert2rhel tool 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
  5. On Alibaba Cloud, purchase a software license for the ECS instance.

    To download RHEL software, you must purchase and activate a Red Hat Enterprise Linux license.

  6. 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-rpms

    The conversion process takes some time. When a response similar to the following one appears, the conversion is complete.

    image.png

  7. Restart the system.

    After the conversion is complete, you are prompted to restart the system. Restarting the system boots the new RHEL kernel. Then, run cat /etc/redhat-release to check whether the operating system was successfully converted.

    sudo reboot
  8. Calibrate the operating system of the instance.

    After the conversion, the Operating System displayed on the ECS instance details page, which is determined by the image used to create the instance, differs from the actual operating system (Red Hat Enterprise Linux Server release 7.9). To revise the operating system platform information of the instance, you can calibrate the instance's operating system.

How do I change repository addresses for CentOS 6 after EOL?

The content at the CentOS 6 repository address http://mirror.centos.org/centos-6/ has been removed. CentOS 6 repositories have also been removed from third-party mirror sites. The Alibaba Cloud repositories at http://mirrors.cloud.aliyuncs.com and http://mirrors.aliyun.com can no longer sync with the CentOS 6 repository. If you continue to use the default CentOS 6 repository configuration on Alibaba Cloud, an error occurs. The following figure shows an example error:centos 6 error

Solution

Important

This topic primarily describes the operations and configurations within an ECS instance. If your server is not an ECS instance, make sure it has public network access. You must also replace the repository address http://mirrors.cloud.aliyuncs.com with http://mirrors.aliyun.com. For example, switch the YUM repository to http://mirrors.aliyun.com/centos-vault/6.10/ and the EPEL repository to http://mirrors.aliyun.com/epel-archive/6/.

  1. Log on to the ECS instance.

    1. Go to the ECS console - Instances page. In the upper-left corner of the page, select the resource group and region where the target resource is located.

    2. Go to the details page of the target instance, click Remote Connection, and select Connect Via Workbench. Log on as prompted to open the terminal page.

  2. Switch the YUM repository.

    sudo vim /etc/yum.repos.d/CentOS-Base.repo 

    Press i to enter edit mode and change the content to 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-6

    After editing, press the Esc key and enter :wq to save and exit the file.

  3. Switch the EPEL repository.

    sudo vim /etc/yum.repos.d/epel.repo

    Press i to enter edit mode and change the content to the following to switch the repository.

    [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-6

    After editing, press the Esc key and enter :wq to save and exit the file.

  4. Run the yum repolist command. If the repository list is displayed and no 404 error is reported, the switch is successful.

How to change the source configuration on a CentOS 6 instance?

When you create a new ECS instance from a custom image, cloud-init automatically initializes the system's repository configuration. To create a custom image from an ECS instance that has a modified repository configuration and you want to preserve this configuration, you must modify the cloud-init configuration file /etc/cloud/cloud.cfg on the instance before you create the custom image.

  1. Edit the /etc/cloud/cloud.cfg file.

    sudo vim /etc/cloud/cloud.cfg
  2. Press i to enter edit mode. Use # to comment out the - source-address module under cloud_init_modules:.

    After commenting, the configuration information in the file appears as follows:cloudinit

  3. After editing, press the Esc key and enter :wq to save and exit the file.

References

For more information about operating system lifecycles, the characteristics of each phase, and standard solutions for handling EOL or extended support phases, see Operating system lifecycle overview.