美文网首页
CentOS7 配置阿里云 yum源

CentOS7 配置阿里云 yum源

作者: Saxon_323e | 来源:发表于2020-08-29 13:39 被阅读0次

1. 禁用 yum插件 fastestmirror

  • 1)修改插件的配置文件
# cp /etc/yum/pluginconf.d/fastestmirror.conf /etc/yum/pluginconf.d/fastestmirror.conf.bak 
# vi  /etc/yum/pluginconf.d/fastestmirror.conf  
enabled = 1         //由1改为0,禁用该插件
  • 2)修改yum的配置文件
# cp /etc/yum.conf /etc/yum.conf.bak
# vi /etc/yum.conf
plugins=1         //改为0,不使用插件

2. 获取阿里云 repo

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.清理原来的缓存,重新缓存

yum clean all
yum makecache

完工!

相关文章

网友评论

      本文标题:CentOS7 配置阿里云 yum源

      本文链接:https://www.haomeiwen.com/subject/chzdsktx.html