Run “yum update” with a specific repo (CentOS/RHEL Linux)

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
This entry was posted in Linux VPS, Tech Support, VPS Hosting. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

Questions? We're here to help.