By Chunmei Xu, Maintainer and SIG head of the Anolis Migration in OpenAnolis Community.
CentOS 8 has ceased maintenance at the end of 2021. To cope with this change, the OpenAnolis Community has launched the "Centos End of Life Zone" to provide migration solutions and long-term stable support for users affected by it. Anolis OS 8 is compatible with the CentOS 8 software ecosystem and other mainstream Linux distributions. It is an open-source, neutral, and open distribution.
To facilitate the smooth migration of CentOS users to Anolis OS and reduce the migration cost, the following migration manual and precautions are presented.
Anolis OS 8 is compatible with CentOS 8.x in terms of ecology and dependency management while making differential development. Therefore, in migration from CentOS 8.x to the latest version of Anolis OS 8, the tool makes full use of compatible attributes and provides a one-click migration script.
CentOS 8.x migration uses packages related to the Anolis OS distribution instead of the CentOS distribution, and reinstalls all system packages in the current system by yum distro-sync.
The software reinstallation does not modify the current system basic configuration, so the system configuration, business configuration, and business data will not be cleared. Therefore, these data need not be reset after the migration.
Before you proceed, please pay attention to the following points before using the migration script:
Download the migration script:
wget https://gitee.com/anolis/centos2anolis/raw/master/centos2anolis.py
Install the migration script to run dependencies:
yum -y install python3
python3 centos2anolis.py
After the migration is complete, the system will prompt the following message. The message indicates that the migration is successful and users can restart to enter the Anolis OS.
The centos2anolis.py provides -V option to record the software package information before and after migration. You can determine whether to add the option as needed. Add -V option. The rpm information before and after the migration is generated in the /var/tmp directory after migration. The name format is:
# Before migration
$(hostname)-rpms-list-before.log
$(hostname)-rpms-verified-before.log
# After migration
$(hostname)-rpms-list-after.log
$(hostname)-rpms-verified-after.log
Maintenance of CentOS was stopped on December 31, 2021, and the corresponding CentOS source was deleted from the official website on January 31, 2022. Because of this, the CentOS instance could not use the repo normally. To rectify this, Alibaba Cloud provides a detailed guide on switching to using the CentOS Vault source.
If you follow the instructions to switch to the CentOS Vault source or configure the Vault source on your own, and then migrate the Anolis OS, you need to check whether the CentOS Vault source remains in the current system after migration.
You can mandate yum repolist
to check:
# yum repolist
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with ID "failovermethod" does not exist
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository id Repository name
AppStream AnolisOS-8 - AppStream
BaseOS AnolisOS-8 - BaseOS
Extras AnolisOS-8 - Extras
PowerTools AnolisOS-8 - PowerTools
base CentOS-8.5.2111 - Base - mirrors.aliyun.com
epel Extra Packages for Enterprise Linux 8 - x86_64
extras CentOS-8.5.2111 - Extras - mirrors.aliyun.com
As shown in the preceding results, "CentOS-8.5.2111-Base-mirrors.aliyun.com" is the residual CentOS repo and it needs to be deleted. Otherwise, Anolis OS and CentOS sources will coexist. Once the yum update is executed, CentOS packages may be installed erroneously.
To delete the CentOS source, perform the following steps:
1. Find the configuration file that provides the CentOS repo
# grep -rn "CentOS-8.5.2111" /etc/yum.repos.d/*.repo
/etc/yum.repos.d/Centos-vault-8.5.2111.repo:14:name=CentOS-8.5.2111 - Base - mirrors.aliyun.com
/etc/yum.repos.d/Centos-vault-8.5.2111.repo:24:name=CentOS-8.5.2111 - Extras - mirrors.aliyun.com
/etc/yum.repos.d/Centos-vault-8.5.2111.repo:34:name=CentOS-8.5.2111 - Plus - mirrors.aliyun.com
/etc/yum.repos.d/Centos-vault-8.5.2111.repo:43:name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.com
/etc/yum.repos.d/Centos-vault-8.5.2111.repo:53:name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com
2. Rename the configuration file found in step 1
mv /etc/yum.repos.d/Centos-vault-8.5.2111.repo /etc/yum.repos.d/Centos-vault-8.5.2111.repo.bak
View the OS version:
# cat /etc/os-release
NAME="Anolis OS"
VERSION="8.4"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="8.4"
PLATFORM_ID="platform:an8"
PRETTY_NAME="Anolis OS 8.4"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
Run the command to check whether the CentOS software package remains in the current system. Normally, the kernel package remains. The kernel package supports the coexistence of multiple versions.
rpm -qa --qf "%{NAME} %{VENDOR}\n" | grep CentOS
1. Can I perform a rollback after an in-place migration failure?
The migration tool does not support rollback. If the migration fails, you are not able to restore to the initial state. Therefore, you should make sure to back up your system before migration.
2. What should I do when something goes wrong during the migration?
Save the migration tool, execute the error message, provide the initial system information (including system version, kernel, software package list, etc.), and attach the migration log file /var/log/centos2anolis.log and reach out to the OpenAnolis team for support.
OpenAnolis Community: https://openanolis.cn/download?lang=en
Remote Attestation EAA: The Final Link for Secure Deployment of Confidential Containers
Anolis OS and OpenAnolis: From Basic Software to Cloud Native
84 posts | 5 followers
FollowAlibaba Cloud Community - July 8, 2022
OpenAnolis - September 19, 2023
OpenAnolis - December 12, 2023
Alibaba Cloud Community - September 5, 2022
OpenAnolis - May 8, 2023
OpenAnolis - September 6, 2022
84 posts | 5 followers
FollowSecure and easy solutions for moving you workloads to the cloud
Learn MoreMigrating to fully managed cloud databases brings a host of benefits including scalability, reliability, and cost efficiency.
Learn MoreMigrate your legacy Oracle databases to Alibaba Cloud to save on long-term costs and take advantage of improved scalability, reliability, robust security, high performance, and cloud-native features.
Learn MoreAlibaba Cloud offers Independent Software Vendors (ISVs) the optimal cloud migration solutions to ready your cloud business with the shortest path.
Learn MoreMore Posts by OpenAnolis