Bug 1151154 - yum-config-manager --enable does not enable all repos
Summary: yum-config-manager --enable does not enable all repos
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Valentina Mukhamedzhanova
QA Contact: Karel Srot
Eva Majorsinova
Depends On:
Blocks: 1205796 1245117 1245122 1246014
TreeView+ depends on / blocked
Reported: 2014-10-09 16:36 UTC by Peter Tselios
Modified: 2016-02-01 02:24 UTC (History)
4 users (show)

Fixed In Version: yum-utils-1.1.31-30.el7
Doc Type: Bug Fix
Doc Text:
Amended "yum-config-manager" commands Previously, running the "yum-config-manager --disable" command disabled all configured repositories, while the "yum-config-manager --enable" command did not enable any. This inconsistency has been fixed. The "--disable" and "--enable" commands now require the use of '\*' in the syntax, and "yum-config-manager --enable \*" enables repositories. Running the commands without the addition of '\*' prints a message asking the user to run "yum-config-manager --disable \*" or "yum-config-manager --enable \*" if they want to disable or enable repositories.
Clone Of:
: 1225754 1245117 1245122 1246014 (view as bug list)
Last Closed: 2015-11-19 12:10:38 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2129 normal SHIPPED_LIVE yum-utils bug fix and enhancement update 2015-11-19 10:49:36 UTC

Description Peter Tselios 2014-10-09 16:36:05 UTC
Description of problem:
If you execute

    yum-config-manager --disable 

(yes, no repo name), it happily disables **all** repositories configured in the system. This is not documented in the man page.

If you execute 

    yum-config-manager --enable

again, without any repo name, it **doesn't** enable all repositories configured on the system. 

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. sudo yum-config-manager --disable
2. yum repolist
3. yum-config-manager --enable
4. yum repolist

(Example outputs from CentOS 7 but it's the same in RHEL 7)

Actual results:
yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repolist: 0

Expected results:

yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.hyve.com
 * extras: mirror.as29550.net
 * updates: mirror.as29550.net
repo id                             repo name                             status
!base/7/x86_64                      CentOS-7 - Base                       8,465
!extras/7/x86_64                    CentOS-7 - Extras                        44
!updates/7/x86_64                   CentOS-7 - Updates                      995
repolist: 9,504

Additional info:
man page has no documentation. Also, no error is raised although this is not the documented behavior.
Also, the behavior is not consistent. Since it disables all repos with the --disable, it should enable all repos with --enable as well.

Comment 3 Karel Srot 2015-04-02 06:23:19 UTC
Hi Valentina,
could you please review this requests, I am curious what would be an appropriate "fix" acceptable for upstream? Is it intentional that --disable works as described (undocumented)?

Comment 4 Valentina Mukhamedzhanova 2015-04-02 08:56:21 UTC
Running 'yum-config-manager --enable' actually does give an error (although the message is kind of misleading).

if opts.enable and not args:
    logger.error("Error: Trying to enable already enabled repos.")
    opts.enable = False

I'd say the appropriate fix would be to change this error message, and add the same logic for --disable. We could also suggest using \* to enable/disable all repos.

Comment 8 Stephen Wadeley 2015-07-21 08:53:57 UTC
I will clone for man page and guide updates

Comment 10 Fedora Update System 2015-10-17 23:21:04 UTC
yum-utils-1.1.31-28.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 errata-xmlrpc 2015-11-19 12:10:38 UTC
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.


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