配置多Yum,设置Yum优先级

*替换默认yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
*清理yum缓存
yum clean all        
yum makecache    

 

*配置多yum源插件
*下载 yum-priorities
yum install -y yum-priorities
cd /etc/yum.repos.d

 

*centos7下载多个厂商的yum以及epel
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

 

*配置 yum-priorities
vi /etc/yum/pluginconf.d/priorities.conf
enabled = 1

 

*配置每个repo文件的优先级,1~99 值越小,优先级越高
echo >> CentOS7-aliyun.repo
echo "priority=1" >> CentOS7-aliyun.repo
Leoco

作者:

所有评论 “配置多Yum,设置Yum优先级”

Kent进行回复 取消回复

邮箱地址不会被公开。

Demon_运维笔记