1)可以执行
wget-o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
但是在我的虚拟机环境下的Linux执行第一个会报错
这里报错是因为系统中没有wget依赖包
2)运行yum makecache生成缓存
切换镜像源之后执行
yum -y install wget
如下图,wget也能使用,镜像源也能使用了