How to exclude certain repositories in yum?

This tutorial introduces how to exclude certain repositories in yum.

Excluding certain repositories is needed usually. One example may be when you have several repositories that have the same package and you only want the one from a certain repository. For my situation, I choose to exclude the google-chrome and other repositories from Google when I am in mainland China since the network connection to the Google repositories usually fails and yum refuses to continue under this situation.

To exclude certain repositories in yum, you can use the option of --disablerepo=repoidglob in yum. For example, the following command exclude the google-chrome and google-talkplugin when updating your system using yum:

# yum --disablerepo=google-chrome --disablerepo=google-talkplugin update
Leave a Reply

Your email address will not be published. Required fields are marked *