Search code examples
requirerpmyumspecifications

RPM package requirements in a special order


I am facing the problem, that I need to install two other RPM's in a special order before installing myRPM. In detail in my RPM I install some config files for sudo and ldap. So, I need these packages to be installed first Requires(pre). Although the pre required package sudo has a required file in /usr/bin/. This file will be installed with the ldap package. So, I need the ldap package to be installed first, then sudo and at least myRPM. My spec file has:

Requires(pre): myldap_rpm sudo

But yum is not going to install the package because sudo needs ldap first. Yum seems to check the dependencies of the pre-required sudo package before installing myldap_rpm Is there any chance to resolve this???

Thanks a lot in advance for sharing your ideas and knowledge.


Solution

  • requires(pre) is a scriptlet dependency. This means that dependency (eg sudo) is only required to run the %pre script. When your package is installed sudo can then safely be uninstalled. This is not what you want here.

    Afaik you cannot change the dependencies of other packages. You can tell what your package depends on, and those dependencies will be installed before your package, but you cannot insert a myldap_rpm dependency to sudo.

    Probably you don't need to reinstall sudo though, probably it would suffice to run some kind of "reload" or "configuration" step after the installation of myldap_rpm.