Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've found out I can use yum --enablerepo= to temporarily enable a disabled Yum repository, but I want to permanently enable a repository.

Is there a preferred Yum command to enable a disabled repository, or should I edit the .repo file under /etc/yum.repos.d?

Using RHEL 5.5.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

No: the configuration files must be edited with a text editor. Yum does not have commands or options to edit the configuration.

share|improve this answer
add comment

If you're using PackageKit on top of yum, you can do it with pkcon:

% pkcon repo-disable myrepo
Enabling repository           [=========================]         
Waiting in queue              [=========================]         
Waiting for authentication    [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Getting information           [=========================]         
% pkcon repo-enable myrepo
Enabling repository           [=========================]         
Waiting in queue              [=========================]         
Waiting for authentication    [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Getting information           [=========================]         
Downloading repository information[=========================]         

Note that, as the output indicates, running the command as a regular user typically means you'll be prompted for authentication before it'll complete.

share|improve this answer
    
(Yes, it really does start the repo-disable output with "Enabling repository". ...I have no idea.) –  FeRD Mar 23 '13 at 13:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.