1)先安装wget
执行命令 yum install -y wget
[root@localhost ~]# yum install -y wget

2) 查询国内镜像源

打开阿里镜像http://mirrors.aliyun.com/
点击帮助:

3)下载CentOS 7的repo文件
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


4)更新镜像源
#清除缓存
yum clean all
#生成缓存
yum makecache

执行命令:yum -y update

更新yum源,等待更新完毕即可。

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2021-11-29
  • 2021-12-31
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
相关资源
相似解决方案