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).

[rpm_repository_something]
includepkgs=vlc

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

includepkgs=vlc*

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:

exclude=*

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