26

Yum源的优先级配置之yum-priorities

 4 years ago
source link: https://bugwz.com/2019/12/01/yum-priorities/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Linux 发行版比较多,同时还有很多个人或组织维护了某些特定用途的安装/升级源。 Yum Priorities 插件可以用来强制保护源。它通过给各个源设定不同的优先级,使得系统管理员可以将某些源设定为最高优先级,从而保证系统的稳定性。

二、yum-priorities

2.1、安装

yum install -y yum-priorities

2.2、配置验证

cat /etc/yum/pluginconf.d/product-id.conf

需要确认的是,如果 enabled 的配置为 1 ,代表已经启用了yum源的配置优先级;

[main]
enabled=1

2.3、配置优先级调整

[Example 1]
name=Example_1
baseurl=http://mirror.centos.org/centos/$releasever/example_1/$basearch/
priority=10
gpgcheck=0
enabled=1

[Example 2]
name=Example_2
baseurl=http://mirror.centos.org/centos/$releasever/example_2/$basearch/
priority=20
gpgcheck=0
enabled=1

关于上述配置的解释为:

  • 其中 priority=NN 的值为: 1-99 ,当数字越大,优先级越低;
  • Example_1Example_2 的源中存在同名同版本的软件包时,优先安装 Example_1 中的安装包;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK