How Do I Configure the Yum Repository for the Target Server After the Migration Is Complete?
Scenarios
The yum repository used by Alibaba Cloud servers does not have a public IP address. After you migrate a server from Alibaba Cloud to Huawei Cloud, the yum repository configured for the source server will be unavailable for the target server.
Constraints
- Huawei Cloud private DNS servers must be configured for the target server for domain name resolution. For how to obtain IP addresses of Huawei Cloud private DNS servers, see What Are Huawei Cloud Private DNS Server Addresses?
- The operations described here apply to x86_64 ECSs.
Procedure
- Log in to the ECS as root. For details, see Logging In to a Linux ECS.
- Back up the CentOS-Base.repo file.
mkdir -p /etc/yum.repos.d/repo_bak/
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo_bak/
- Use curl to download the CentOS-Base.repo file, and save the file into /etc/yum.repos.d/:
- CentOS 6
The CentOS community no longer provides security patch update or image source support for CentOS 6. The CentOS 6 image source package has been removed from the source address http://mirror.centos.org/centos-6/ and third-party images.
- CentOS 7
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-Base-7.repo
- CentOS 6
- Clear the original yum cache:
- Generate a new cache.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.