Including one package in a yum repository
by morecode
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.
Advertisement
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.