Including one package in a yum repository

Yum can be surprisingly simple and frustrating at once. To add only one package from a repository you can do the following.

In the yum configuration file for the repository (normally this is /etc/yum.repos.d/$repository.repo).


You can also glob to include all packages of that type, such as:


Save the file, and search/install new packages. Yum will only see packages of “vlc” and nothing else.

If you are looking to do the opposite, the keyword is `exclude`. To exclude all rpms from a repository for instance:


Don’t add both exclude and includepkgs together without careful consideration.


One response to “Including one package in a yum repository

  1. I’ve added the EPEL repo to one of our RHEL servers. To avoid conflicts, I add each package that we install from EPEL to the includpkgs line in the .repo file. Do you know of a flag I can pass to yum in order to ignore includepkgs for a single operation? I tried –enablerepo=epel but that didn’t work.

    It would be helpful to let me search for packages before adding them to the includepkgs line in epel.repo.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: