CentOS6/7~配置多个yum源,并设置优先级

时间:2018-03-30 14:08:03   收藏:0   阅读:5178
yum install -y yum-priorities

#安装yum优先级插件(本文优先级设置为阿里,163,中科大,epel)


cd /etc/yum.repos.d

#CentOS6

wget -O CentOS6-aliyun.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O CentOS6-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
wget -O CentOS6-ustc.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2
yum -y install epel-release

 #CentOS7

wget -O CentOS7-aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O CentOS7-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget -O CentOS7-ustc.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3
yum -y install epel-release

#配置priority

技术分享图片

#确认启用配置优先级功能,priority=n ∈(1~99), 值越小,优先级越高。

#分别在对应的*.repo文件中设置好优先级

#示例:

echo >> CentOS7-aliyun.repo
echo "priority=1" >> CentOS7-aliyun.repo

技术分享图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!