Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the Yum Source

  1. View the Yum source.
    Check for the Yum source (a .repo file). If it is available, go to 5.
    1
    ls /etc/yum.repos.d/
    
  2. Back up the Yum source.
    1
    2
    3
    cd /etc/yum.repos.d
    mkdir bak
    mv *.repo bak
    
  3. Configure the Internet Yum source.
    • On CentOS 7.6:
      1
      wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-AltArch-7.repo
      
    • On CentOS 8.1:
      1
      2
      wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo
      sed -i "s/\$releasever/8-stream/g" /etc/yum.repos.d/CentOS-Base.repo
      
  4. View the Yum source.
    1
    2
    ls /etc/yum.repos.d/
    cat /etc/yum.repos.d/CentOS-Base.repo
    
  5. Make the Yum source take effect.
    1
    2
    3
    yum clean all
    yum makecache
    yum list