channel priorities for yum

Latest response

If yum-plugin-priorities package has been removed from rhel7 is there the equivalent functionality provided? I have noticed now that the rhel-x86_64-server-7 and rhel-x86_64-server-optional-7 behave like they have the highest number (ie. worst) priority when competing against other repos. I got burned when yum selected a package from nux-dextop in preference to a redhat channel.

Is there any way to set a yum priority for a redhat channel? I am on a Satellite subscription if that makes any difference.
Bill Sebok wls@astro.umd.edu

Responses

Hey Bill,
I still see the package in the Optional Channel (I suppose it's somewhat ironic that you need to add the channel that might cause you issues, to get the package you need to prevent that channel from causing issues ;-)

yum-plugin-priorities-1.1.31-25.el7_0.noarch    RHEL Server Optional (v. 7 64-bit x86_64)
yum-plugin-priorities-1.1.31-24.el7.noarch  RHEL Server Optional (v. 7 64-bit x86_64) 

An example of the management (for those who have not used this functionality)

# yum install -y yum-plugin-priorities yum-utils
# yum-config-manager --setopt=”rhel-7-server-openstack-6.0-rpms.priority=1” --enable rhel-7-server-openstack-6.0-rpms

example source:
https://access.redhat.com/products/red-hat-enterprise-linux-openstack-platform/get-started

It didn't work for me. I had installed yum-plugin-priorities from rhel-x86_64-server-optional-7 (I had previously installed it from centos, and ran the command:
yum-config-manager --setopt "rhel-x86_64-server-7.priority=1" --enable rhel-x86_64-server-7

and got the output:Loaded plugins: fastestmirror, langpacks, priorities, product-id, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
========================== repo: rhel-x86_64-server-7 ==========================
[rhel-x86_64-server-7]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://rhsat.umd.edu/XMLRPC/GET-REQ/rhel-x86_64-server-7
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/rhel-x86_64-server-7
check_config_file_age = True
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = True
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/x86_64/7Server/rhel-x86_64-server-7/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/rhel-x86_64-server-7/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
hdrdir = /var/cache/yum/x86_64/7Server/rhel-x86_64-server-7/headers
http_caching = True
includepkgs =
ip_resolve =
keepalive = 0
keepcache = True
label = rhel-x86_64-server-7
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 3600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = Red Hat Enterprise Linux Server (v. 7 for 64-bit x86_64)
password =
persistdir = /var/lib/yum/repos/x86_64/7Server/rhel-x86_64-server-7
pkgdir = /var/cache/yum/x86_64/7Server/rhel-x86_64-server-7/packages
priority = 99
proxy =
proxy_dict = {'ftp': '', 'http': '', 'https': ''}
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 1
rhn_needed_headers = X-RHN-Server-Id,
X-RHN-Auth-User-Id,
X-RHN-Auth,
X-RHN-Auth-Server-Time,
X-RHN-Auth-Expire-Offset
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 120.0
ui_id = rhel-x86_64-server-7
ui_repoid_vars = releasever,
basearch
up2date_cfg = <up2date_client.config.Config instance at 0x1548b00>
username =

Traceback (most recent call last):
File "/bin/yum-config-manager", line 180, in
repo.cfg.options, repo.iteritems, repo.optionobj,
AttributeError: 'RhnRepo' object has no attribute 'cfg'

with a crash dump emailed to me (sorry but I haven't figured out how to send it). From the above note
that priority=99, the priority didn't get changed. I was getting results like this before, a crash and no change in priority.

You may wish to open a case on this one, as it seems a bit odd...
https://access.redhat.com/support/case

What do you get when you run the following (and are all the priorities currently 99?)

# yum-config-manager | egrep "^\\[|priority ="
# yum list yum-plugin-priorities
# rpm -qi yum-plugin-priorities
# rpm -qVv yum-plugin-priorities 

You may want to completely remove and re-install yum-plugin-priorities.

To have your code output presented in a nice format, start and end the code with 3 x tilde's ~~~
~~~
paste code here
~~~

The Customer Portal is user-supported (and some Red Hat folks will participate as well).

I'm not sure I have the privileges to open a case. The satellite was arranged by the Division of Information Technology at the University of Maryland and I am a system manager of the Astronomy Department, i.e. somewhat at the periphery. I'll make a inquiry as to my status. However, I'd like at least to file a bug. I suspect that I'll find out that using priorities for redhat channels is no longer supported in rhel7. However I have thought of a hack workaround (given at the end).

The URL "https://access.redhat.com/support/case" now gives a 404.

What do you get when you run the following (and are all the priorities currently 99?)

yum-config-manager | egrep "^[|priority ="

[main]
[adobe-linux-x86_64]
priority = 99
[atrpms]
priority = 5
[epel]
priority = 2
[google-chrome]
priority = 99
[nux-dextop]
priority = 4
[rhel-x86_64-server-7]
priority = 99
[rhel-x86_64-server-7-rhscl-1]
priority = 99
[rhel-x86_64-server-optional-7]
priority = 99
[rhel-x86_64-server-supplementary-7]
priority = 99
[rpmforge]
priority = 6
All Red Hat channels have priority 99 (the default). The non-RedHat repos have their priorities set by the "priority" keyword added to their files in /etc/yum.repos.d.

yum list yum-plugin-priorities

Loaded plugins: fastestmirror, keys, langpacks, priorities, product-id,
: rhnplugin, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
* epel: mirror.umd.edu
* nux-dextop: li.nux.ro
* rpmforge: mirror.us.leaseweb.net
543 packages excluded due to repository priority protections
Installed Packages
yum-plugin-priorities.noarch 1.1.31-25.el7_0 @rhel-x86_64-server-optional-7

rpm -qi yum-plugin-priorities

Name : yum-plugin-priorities
Version : 1.1.31
Release : 25.el7_0
Architecture: noarch
Install Date: Thu 12 Feb 2015 03:08:21 PM EST
Group : System Environment/Base
Size : 29127
License : GPLv2+
Signature : RSA/SHA256, Mon 11 Aug 2014 03:40:38 AM EDT, Key ID 199e2f91fd431d51
Source RPM : yum-utils-1.1.31-25.el7_0.src.rpm
Build Date : Tue 05 Aug 2014 10:26:02 AM EDT
Build Host : x86-024.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc. http://bugzilla.redhat.com/bugzilla
Vendor : Red Hat, Inc.
URL : http://yum.baseurl.org/download/yum-utils/
Summary : plugin to give priorities to packages from different repos
Description :
This plugin allows repositories to have different priorities.
Packages in a repository with a lower priority can't be overridden by packages
from a repository with a higher priority even if repo has a later version.

rpm -qVv yum-plugin-priorities

......... c /etc/yum/pluginconf.d/priorities.conf
......... /usr/lib/yum-plugins/priorities.py
......... /usr/lib/yum-plugins/priorities.pyc
......... /usr/lib/yum-plugins/priorities.pyo
......... /usr/share/doc/yum-plugin-priorities-1.1.31
......... d /usr/share/doc/yum-plugin-priorities-1.1.31/COPYING

"You may want to completely remove and re-install yum-plugin-priorities."
I did so and had the same issue.

Here is my workaround hack: Edit the file /usr/lib/yum-plugins/priorities.py inside the installed package yum-plugin-priorities changing both instances of the number 99 to the number 1, thus changing the default priority from 99 to 1. A more official version of this would be to allow setting the default value in /etc/yum/pluginconf.d/priorities.conf and wrapping all of this in a patch included in the source rpm. Or even better, fix yum-rhn-plugin to allow priorities.

I apologize for that Bill - my cut-and-paste ability seems lacking, the url should have an 's' at the end
https://access.redhat.com/support/cases - I believe you are correct in that it does require a Red Hat login though.

You bring up an interesting point: why does it default all the priorities to 99? I suppose on a system with only Red Hat channels, the priorities are not utilized.

I'm glad you have a work-around devised. I would worry that there is a possibility that file will be updated by a package update. I have not had a similar experience using the priorities yet - but, I'll do some poking around this weekend to see if I can replicate the behavior.

I apologize for that Bill - my cut-and-paste ability seems lacking, the url should have an 's' at the end
https://access.redhat.com/support/cases - I believe you are correct in that it does require a Red Hat login though - I believe you are correct in that it does require a Red Hat login though."

I was using my Red Hat login, I just don't believe that my login has the permissions to deal with cases. When I go to the url: "https://access.redhat.com/support/cases" I get: "User does not have permissions to manage cases." That is consistent with the message I get when I try to forward to Red Hat the error reports I get from abrt.

"You bring up an interesting point: why does it default all the priorities to 99?"

That is very strange, that it defaults to the lowest priority. That becomes a problem when a repo has a problem setting the priority.

"I suppose on a system with only Red Hat channels, the priorities are not utilized."

I think that is the main point, that Red Hat is not expecting you to reference any repo other than Red Hat channels. That is strange when one considers the existence of the repo epel from the Fedora people which must, at least, have Red Hat's blessing. At least epel tries to avoid conflicts with Red Hat. The problem comes when one needs to deal with repos that haven't removed all package conflicts with Red Hat and so has the need to use priorities.

"I'm glad you have a work-around devised. I would worry that there is a possibility that file will be updated by a package update."

That problem I've solved before. I get the source RPM, add my hack as a patch and change the version number to something higher than current, and finally create a local repo for such rpms with a higher (numerically lower) priority than any others. I'll change my default priority from 1 to 2 to make room for a repo with a priority of 1.

Also, I get the feeling that yum-plugin-priorities does not change that often.

Thank you for your help with all of this. I have found dealing with Red Hat channels is a pain -- it was much easier with CentOS and Scientific Linux.

Hello

I looked into this. The plugin has been in the Optional channel from RHEL 6.0, from the point where the 'optional' concept was introduced.

My colleague says the described case is what is wanted by default. RHEL is 'base' for other repositories. If you have customized versions of your own or Red Hat's packages (or even Red Hat layered products), they should take priority. Using user-defined priorities is of course possible via this plugin.

Before subscribing to the Optional channel see the Scope of Coverage Details page. If you decide to install packages from these channels, follow the steps documented in the article called How to access Optional
and Supplementary channels, and -devel packages using Red Hat Subscription Manager (RHSM)?
on the RedHat Customer Portal.

BTW, I found this Kbase article which mentions the plugin and I have updated it too: How to set priority to specific repositories on systems registered to RHN Classic or Red Hat Satellite v 5.x?