CentOS 7 系统修改 yum 源

备份系统原 yum

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

替换 yum

  • 华为 yum
# wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
  • 阿里 yum
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  • 网易163 yum
#  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

替换 EPEL 源 - 可选

  • 华为 EPEL
# wget -O /etc/yum.repos.d/epel.repo https://file.cnxiaobai.com/Linux/Yum/epel.repo
  • 阿里 EPEL
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

清理缓存

# yum clean all

生成新的缓存

# yum makecache

更新系统

# yum -y update


标题:CentOS 7 系统修改 yum 源
作者:Mune
地址:https://cnxiaobai.com/articles/2021/04/21/1618991199230.html

    评论
    1 评论
    2021-07-05 16:19 回复»

avatar

取消