1. 首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

    2.下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

Centos7:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo

Centos6:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos5:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS5-Base-163.repo

 

    3.运行以下命令生成缓存

yum clean all
yum makecache

相关文章:

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