To tell yum to check only a specific repository for updates, append the yum command like below:
yum --disablerepo="*" --enablerepo="my-repo" update
The –disablerepo=”*” disables all repositories, and then –enablerepo=”my-repo” enabled only my-repo. Note that the repository you enable must already be configured in the system, or this command will not work.
First, you may want to check which repositories are currently active in the system. Confirm that the repository you want to update from is enabled. To get a list of all repositories currently active, run:
yum repolist
The same command line options can be used with yum install and other operations, for example
yum --disablerepo="*" --enablerepo="my-repo" install httpd
This article applies to:
- CentOS Linux
- Fedora Linux
- RHEL