Cannot find a valid baseurl for repo: base/7/x86_64 解决办法
执行
yum install -y yum-utils
出现此报错
处理一 :检查网络连接
确保你的服务器可以访问互联网。你可以使用 ping
命令来测试:
ping www.baidu.com
若能访问外网,则网络没问题,否则检查网络
处理二:利用工具MobaXterm 修改CentOS-Base.repo文件,做好备份
将以下替换文件内容
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
最后重新执行 yum install -y yum-utils