51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

CentOS7执行sudo yum install -y yum-utils报错Cannot find a valid baseurl for repo: base/7/x86_64

问题:

CentOS7运行sudo yum install -y yum-utils时报错:
image-20240925114438026


Cannot find a valid baseurl for repo: base/7/x86_64

解决办法:

换成阿里云的repo文件

  1. 备份原来的repo文件sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    image-20240925115240031


  2. 下载阿里云的repo配置文件sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    image-20240925115309789


  3. 刷新YUM元数据缓存

    sudo yum clean all
    sudo yum makecache
    

    image-20240925120028256


  4. 再执行sudo yum install -y yum-utils命令,可以正常运行

    image-20240925115915536


赞(0)
未经允许不得转载:工具盒子 » CentOS7执行sudo yum install -y yum-utils报错Cannot find a valid baseurl for repo: base/7/x86_64