Add Yum Repository
#yum-config-manager --add-repo repository_url
where repository_url is a link to the .repo file.
For example, to add a repository located at http://www.test.com/test.repo, type the following at a shell prompt:
# yum-config-manager --add-repo http://www.test.com/xyz.repo
Enable Yum Repository
After adding a repository, you have to enable it. So to enable a particular repository, you have to run the following command as a root user.
#yum-config-manager --enable repository_id
where repository_id indicates a unique name of the repository in the available repository list.
Alternatively, multiple repositories can be enabled by using matching expressions.
#yum-config-manager --enable matching_expression
For example, to enable repositories defined in the [xyz], [xyz-debuginfo], and [xyz-source]sections, you have to enter:
#yum-config-manager --enable xyz\*
When successful, the yum-config-manager --enable command displays the current repository configuration.
Disable Yum Repository
Similarly, a Yum repository can be disabled by executing the following command as a root user.
#yum-config-manager --disable repository_id
Similar to yum-config-manager --enable, you can use a matching expression to disable all matching repositories by executing the following command.
#yum-config-manager --disable matching_expression
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.