Help Center> Server Migration Service> FAQ> Target Server Configuration and Launch> How Do I Configure the Yum Repository After Migration?

How Do I Configure the Yum Repository After Migration?

Scenarios

If you are migrating servers to from Alibaba Cloud to HUAWEI CLOUD, note that the yum repository used on Alibaba Cloud does not use a public server address. Therefore, after a server is migrated to HUAWEI CLOUD, the originally configured repository will be unavailable for your target server. You will need to change the repository settings.

Constraints

  • The operations described in this section apply to x86_64 ECSs.

Procedure

  1. Log in to the ECS as root. For details, see Logging In to a Linux ECS.
  2. Run the following commands to 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 Do I Replace an Image Source with an Official HUAWEI CLOUD Image Source?

    • CentOS 7

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

  4. Run the following command to clear the original yum cache:

    yum clean all

  5. Run the following command to generate a new cache:

    yum makecache