Bug 845349 - [RFE] As a Red Hat user, I would like to use the exclude line in the yum.repos.d files and not have them blown away.
[RFE] As a Red Hat user, I would like to use the exclude line in the yum.rep...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Bryan Kearney
Entitlement Bugs
: FutureFeature
: 1097651 (view as bug list)
Depends On:
Blocks: 771481
  Show dependency treegraph
 
Reported: 2012-08-02 14:58 EDT by Bryan Kearney
Modified: 2014-05-22 07:22 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:55:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bryan Kearney 2012-08-02 14:58:08 EDT
Users woudl like to add exclude lines, but these are getting blown away by subscription manager when the repo file is recreated.
Comment 1 xingge 2012-09-05 04:43:27 EDT
I would like to develop test case for the issue, but I can not get more detailed information over the issue, could you help provide the design details of it or detailed test steps on how to verify it?
Comment 2 Laszlo Ersek 2012-09-05 04:58:49 EDT
One live reproducer is flash-plugin. On my x86_64 RHEL-6 system it is available from two repositories:

  $ cat /etc/yum.repos.d/adobe-linux-x86_64.repo 
  [adobe-linux-x86_64]
  name=Adobe Systems Incorporated
  baseurl=http://linuxdownload.adobe.com/linux/x86_64/
  enabled=1
  gpgcheck=1
  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

  # yum info flash-plugin
  Installed Packages
  Name        : flash-plugin
  Arch        : x86_64
  Version     : 11.2.202.238
  Release     : release
  Size        : 19 M
  Repo        : installed
  From repo   : adobe-linux-x86_64
  Summary     : Adobe Flash Player 11.2
  URL         : http://www.adobe.com/downloads/
  License     : Commercial
  Description : Adobe Flash Plugin 11.2.202.238
              : Fully Supported: Mozilla SeaMonkey 1.0+, Firefox 1.5+,
              : Mozilla 1.7.13+

  Available Packages
  Name        : flash-plugin
  Arch        : i686
  Version     : 11.2.202.238
  Release     : 1.el6
  Size        : 5.3 M
  Repo        : rhel-6-workstation-supplementary-rpms
  Summary     : Adobe Flash Player 11.2 i386
  URL         : http://www.adobe.com/downloads/
  License     : Commercial
  Description : Adobe Flash Plugin 11.2.202.238
              : Fully Supported: Mozilla SeaMonkey 1.0+, Firefox 1.5+,
              : Mozilla 1.7.13+

The x86_64 flash plugin is only available from the "adobe-linux-x86_64" repo, and the i686 flash plugin is only available from the "rhel-6-workstation-supplementary-rpms" repo. I have the x86_64 version installed and would like to keep it that way.

Whenever I run "yum update", yum wants to "update" the x86_64 version to the i686 version (the Version numbers are identical between the two bitnesses). Therefore I must invoke "yum update --exclude=flash-plugin": this way it doesn't touch the flash-plugin package. Unfortunately that's not a good way to run "yum update" blindly, because that command line won't update flash-plugin even if Adobe releases a genuinely new version!

Therefore I'd like to exclude "flash-plugin" from "rhel-6-workstation-supplementary-rpms" *only*.

Thanks!
Comment 3 Bryan Kearney 2012-09-05 08:11:45 EDT
the yum.repos.d file allows you to define an excludes line. Your test should be to set a package name, run subscription-manager-refresh and then yum list all and still see the value in the excludes line. Before the fix, the value will be reset.
Comment 4 James Bowes 2012-09-06 06:38:35 EDT
Fixed in master, e25e2b93
should be in subscription-manager 1.0.18
Comment 7 John Sefler 2012-11-26 11:37:54 EST
Demonstrating the problem on version...
[root@rhsm-compat-rhel63 ~]# rpm -q subscription-manager
subscription-manager-0.99.19.4-1.el6_3.x86_64

After registering and subscribing my rhel63 server system, I now have the following repo managed at the tail end of my redhat.repo file:

[root@rhsm-compat-rhel63 ~]# cat /etc/yum.repos.d/redhat.repo | tail -12

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/1400535588112356773-key.pem
sslclientcert = /etc/pki/entitlement/1400535588112356773.pem
metadata_expire = 86400
[root@rhsm-compat-rhel63 ~]# 

Now let's manually add some valid repository options...

[root@rhsm-compat-rhel63 ~]# echo "priority=10" >>  /etc/yum.repos.d/redhat.repo
[root@rhsm-compat-rhel63 ~]# echo "exclude=rhev-agent *-plugin-*" >>  /etc/yum.repos.d/redhat.repo
[root@rhsm-compat-rhel63 ~]# cat /etc/yum.repos.d/redhat.repo | tail -14

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/1400535588112356773-key.pem
sslclientcert = /etc/pki/entitlement/1400535588112356773.pem
metadata_expire = 86400
priority=10
exclude=rhev-agent *-plugin-*

^^ See, the extra repository options that I manually added are there.  However, after we run a yum transaction, the subscription-manager plugin will clobber them...

[root@rhsm-compat-rhel63 ~]# yum -q repolist
[root@rhsm-compat-rhel63 ~]# cat /etc/yum.repos.d/redhat.repo | tail -12

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/1400535588112356773-key.pem
sslclientcert = /etc/pki/entitlement/1400535588112356773.pem
metadata_expire = 86400
[root@rhsm-compat-rhel63 ~]#

^^ BANG! the manually added "priorty" and "exclude" repository options have been clobbered.
Comment 8 John Sefler 2012-11-26 14:59:48 EST
Verifying fix on version...
[root@jsefler-6 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.1.10-1.el6.x86_64
python-rhsm-1.1.6-1.el6.x86_64


[root@jsefler-6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription --username stage_test_12 --autosubscribe
Password: 
The system has been registered with id: d670d92b-cb53-4fc5-9e44-6db319ec794e 
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed

[root@jsefler-6 ~]# yum -q repolist
[root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo | tail -12

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/7600924276684976894-key.pem
sslclientcert = /etc/pki/entitlement/7600924276684976894.pem
metadata_expire = 86400
[root@jsefler-6 ~]# echo "priority=10" >>  /etc/yum.repos.d/redhat.repo
[root@jsefler-6 ~]# echo "exclude=rhev-agent *-plugin-*" >> /etc/yum.repos.d/redhat.repo
[root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo | tail -14

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/7600924276684976894-key.pem
sslclientcert = /etc/pki/entitlement/7600924276684976894.pem
metadata_expire = 86400
priority=10
exclude=rhev-agent *-plugin-*
[root@jsefler-6 ~]# yum -q repolist
[root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo | tail -14

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/7600924276684976894-key.pem
sslclientcert = /etc/pki/entitlement/7600924276684976894.pem
metadata_expire = 86400
priority = 10
exclude = rhev-agent *-plugin-*
[root@jsefler-6 ~]# subscription-manager refresh
All local data refreshed
You have new mail in /var/spool/mail/root
[root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo | tail -14

[rhel-6-server-rhev-agent-rpms]
name = Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/rhev-agent/3/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/7600924276684976894-key.pem
sslclientcert = /etc/pki/entitlement/7600924276684976894.pem
metadata_expire = 86400
priority = 10
exclude = rhev-agent *-plugin-*
[root@jsefler-6 ~]#


Moving to VERIFIED: manually added redhat.repo repository options are no longer clobbered by yum transactions.
Comment 11 Bryan Kearney 2012-11-27 07:53:40 EST
Per the current rules, this would not qualify for a z stream.
Comment 12 Laszlo Ersek 2012-11-27 08:39:45 EST
(In reply to comment #2)

> Therefore I'd like to exclude "flash-plugin" from
> "rhel-6-workstation-supplementary-rpms" *only*.

Works perfectly.

subscription-manager-1.1.10-1.el6.x86_64
python-rhsm-1.1.6-1.el6.x86_64

Thank you again.
Comment 15 errata-xmlrpc 2013-02-21 03:55:29 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0350.html
Comment 16 Amit Upadhye 2014-05-22 07:22:49 EDT
*** Bug 1097651 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.