Help Center/ Server Migration Service/ FAQs/ Target Server Configuration and Launch/ How Do I Configure the Yum Repository for the Target Server After the Migration Is Complete?
Updated on 2024-07-17 GMT+08:00

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

  • The operations described here apply to x86_64 ECSs.

Procedure

  1. Log in to the ECS as root. For details, see Logging In to a Linux ECS.
  2. 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/

  3. 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. If you want to continue to use CentOS 6, see How Can I Use the Automated Tool to Configure a Huawei Cloud Image Source (x86_64 and Arm)?

    • CentOS 7

      curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-Base-7.repo

  4. Clear the original yum cache:

    yum clean all

  5. Generate a new cache.

    yum makecache