I want to enable priority plugin for yum which is called yum-plugin-priorities
.
After that I enable and install that plugin I see that plugin is working but behavior is weird.
Even I know package is exist in one of my repository yum says package is not exist.
yum install ansible-2.2.0.0-1.el7
Loaded plugins: priorities
2158 packages excluded due to repository priority protections
No package ansible-2.2.0.0-1.el7 available.
Error: Nothing to do
After search I found how to fix
There are 2 fixes that solves my problem but I think I shouldn't need them.
First way to install package
yum install ansible-2.2.0.0-1.el7 --disableplugin=priorities
I don't want to that because that can be also can create problem for later.
Second way to install package
Increasing repository priority from /etc/yum.repos/xxx.repo
$ sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n # Shows priorities of repos
priority = 11 [rhel7-server]
priority = 12 [rhel7-extras]
priority = 13 [rhel7-optional]
priority = 20 [puppetlabs-deps]
priority = 21 [puppetlabs-products]
priority = 50 [foo-rpms] # My spesific ansible version is here and If increase priority to 10 it install my package
priority = 99 [cmd]
priority = 99 [epel]
priority = 99 [bar-rpms]
Package usage explain itself
If a package is in more than one repository, it will be installed from the repository with the highest priority.
Question
I understand that via that plugin, If I were say yum install ansible
I could get the lower version of the package from the repository which has highest priority but why does not allow to install specific version of the package and says package is not available while it's exist?
Another version infos:
RHEL version
Red Hat Enterprise Linux Server release 7.4 (Maipo)
Yum version:
3.4.3
Installed: rpm-4.11.3-25.el7.x86_64 at 2017-11-09 09:40
Installed: yum-3.4.3-154.el7.noarch at 2017-11-09 09:40
Plugin version
$ yum info yum-plugin-priorities
Loaded plugins: priorities
2158 packages excluded due to repository priority protections
Installed Packages
Name : yum-plugin-priorities
Arch : noarch
Version : 1.1.31
Release : 46.el7_5
Another debug info that shows my package is excluded:
yum install -d3 ansible-2.2.0.0-1.el7
--> ansible-2.2.0.0-1.el7.noarch from foo-rpms excluded (priority)