Welcome to the Linux Foundation Forum!

Enabling/disabling a yum repo permanently or transiently

This sentence in the slide "What is yum", Chapter 8 is not correct and a bit misleading:
"You can toggle the use of a particular repository on or off by changing the value of enabled to 0 or 1, or using the --disablerepo=somerepo and --enablerepo=somerepo options when using yum."

The options --disablerepo/--enablerepo the referenced repo relates to lasts only for that specific yum command you are running, without changing the persistent enablement status of the repository in the repo file, while editing the variable "enabled" in the .repo file is a persistent change that will disable (0) or enable (1) the repo for good until you edit it again.

As is described and redacted in the lesson one inferes that they are totally equivalent actions, and it is clear they are not.


  • coop
    coop Posts: 913

    I'm not sure if you are complaining about something. The language about a one time on or off is clear. editing the file to say enabled=0 or 1 is also clear. you certainly have understood. If you don't want to edit the file by hand you can use

    sudo yum config-manager --enable rep (or --disable repo)

    from the command line. I don't see where the course says using the --disablerepo option is persistent. I don't remember if the course talks about editing the file by hand, but it does tell you what is in the repo files and gives examples in the lab for example or talks about epel.

  • I am not complaining. I am not saying the course says using the option is persistent. I am just saying that just as it is redacted, one inferes that following any of the approaches are equivalent, and it is clear they are not. For the record, OR is used to point to equivalent alternatives. In this case they are not.

  • luisviveropena
    luisviveropena Posts: 1,101

    Hi @jesusmfedz ,

    I went through the information and I don't think it's a good deal. It doesn't say the change is permanent in the second case, so it's not wrong. Fortunately you made the test and learn something about the differences, and that's pretty good.

    Many regards,

  • Hello Luis,

    Thank you for the comment.

    No problem at all, I like to explore the features for the commands in the labs, so one eventually finds the semantics and side effects of every option, even those with typos.
    Like, for instance, in the 9.5 Labs, Exercise 9.2, Step 4: a blank space is needed between "info" and "--requires" for the command to work.
    And not, I am not complaining, just pointing out the typo. You may want to fix it for future versions of the course.


  • luisviveropena
    luisviveropena Posts: 1,101

    Hi Jesús,

    Ok, thanks for letting us know of these details, so we chan check and fix them :)



Upcoming Training