All Products
Search
Document Center

You cannot run the yum command on Aliyun Linux 2 ECS instances of the classic network system.

Last Updated: Apr 29, 2020

Problem Description

If the ECS instance meets the following conditions, run yum update the command failed and the returned repository address is invalid.

  • Image: aliyun-2.1903-x64-20G-alibase-20190327.vhd and all later versions.
  • Kernel: kernel-4.19.24-9.al7 and later kernel versions.
  • Network: classic network.

Cause of problem

If your Aliyun Linux 2 ECS instances are not supported by Alibaba Cloud, you may fail to connect to the address specified in the default YUM repository.

Solution

Alibaba Cloud reminds you that:

  • If you have any risky operations on an instance or data, pay attention to the disaster tolerance and fault tolerance capabilities of the instance to ensure data security.
  • If you modify the configuration and data of an instance (including but not limited to ECS and RDS), we recommend that you create snapshots or enable RDS log backup.
  • If you have granted permissions on the Alibaba Cloud platform or submitted security information such as the logon account and password, we recommend that you modify the information as soon as possible.

Temporary solution

Follow these steps to resolve the issue temporarily.

  1. Log on to the target ECS instance.
  2. Modify /etc/yum.repos.d/aliyun-base.repo configuration file. The modified content is as follows:
    Note: If the configuration file does not exist, create it first.
    [base]
    name=AliYun-$releasever - Base - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/alinux/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/alinux/RPM-GPG-KEY-ALIYUN
    
    #released updates
    [updates]
    name=AliYun-$releasever - Updates - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/alinux/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/alinux/RPM-GPG-KEY-ALIYUN
    
    # additional packages that may be useful
    [extras]
    name=AliYun-$releasever - Extras - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/alinux/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/alinux/RPM-GPG-KEY-ALIYUN
    
    # plus packages provided by Aliyun Linux dev team
    [plus]
    name=AliYun-$releasever - Plus - mirrors.aliyun.com
    baseurl=http://mirrors.aliyun.com/alinux/$releasever/plus/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/alinux/RPM-GPG-KEY-ALIYUN
  3. Delete/etc/yum.repos.d/ table of contents others under .repo configuration files, such as/etc/yum.repos.d/epel.repo.

Fixed solution

Classic network ECS instances are not supported by Alibaba Cloud, we recommend that you change the network type of the ECS instances to VPC. For more information, see the following documents.

Applicable to

  • Elastic Compute Service