Change the YUM software source of CentOS 7 to the mirror source of Alibaba Cloud

You can follow the steps below to change the YUM software source of CentOS 7 to the mirror source of Alibaba Cloud:

  1. Back up the original CentOS-Base.repo file first

    sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    
  2. Download the repo file of Alibaba Cloud's CentOS 7

    sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    
  3. Clear and generate new cache

    sudo yum clean all
    sudo yum makecache
    

Now your CentOS 7 yum software source should have been changed to the Alibaba Cloud mirror source, you can try to install or update the software package to see if it succeeds.

This process assumes that your system has the wget command, if not, you can use yum install wget -ythe command to install it first. At the same time, this process requires corresponding network access rights, otherwise the repo file cannot be downloaded from Alibaba Cloud.

Guess you like

Origin blog.csdn.net/u011197085/article/details/131486438