Is it possible to add a yum repository as part of the Requires field on an RPM spec file? For instance:

Requires: my_custom.repo, software.xyz (only available in my_custom.repo)

If not what is the appropriate way to automate this type of inclusion?

1 Answer 1


As I am not sure it is possible in the 'Requires' part of the script to specify a repo as a dependency, it may be better to include the repo file in the package you are building, or add as a dependency a RPM that provides it.

A existing solution for including the repo file is the one used in the Google Chrome package, which is to add the repo file and GPG key from a script in cron (it installs it under /etc/cron.daily/google-chrome) - I think this also means the repo is updated as well. This also determines the package manager in use so it can put the repo in the right place (e.g. for yum /etc/yum.repos.d/google-chrome.repo), specify the correct architecture etc.

Including the repo in a RPM package is also helpful in that many trusted repos include GPG keys, which often need to be installed by the RPM, so they don't have to be added manually if gpgcheck is enabled for that repo. A example of this is is the RPMfusion repo package..

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .