1

I have 3 packages A, B and C. C depends on B, B depends on A. I've created a repo of these 3 packages. When I run yum install C, it installs B first, then A, and then C. How do I make sure it installs package A before package B?

1
  • Bring out the SPECs, please. Mar 19, 2015 at 9:05

1 Answer 1

2

You have to specify the dependencies properly in the spec file of your .rpm packages. Rpm will manage to install all the required packages automatically.

A .spec file example could be:

#
# Example spec file 
#
Summary: PACKAGE C
Name: PACKAGE C
Version: 1.0
Release: 1
Copyright: GPL
Group: Applications/Sound
Requires: PACKAGE B >= 1.0.0
Source: URL
URL: URL
Distribution: Linux
Vendor: Software, Inc.
Packager: Santa Claus <[email protected]>

%description
SOME DESCRIPTION HERE!

Have a look to Requires section (or BuildRequires if you are compiling your package)

On the other hand, there a another post in stackoverflow that can be usefull for you: https://stackoverflow.com/questions/11418814/where-does-rpm-look-for-dependencies

Another good resource to understand the creation process of a rpm package: https://fedoraproject.org/wiki/How_to_create_a_GNU_Hello_RPM_package

Regards

1
  • 1
    This is a solid and correct answer, but what if one of the packages is 3rd party, say B, which incorrectly omits the "Requires" line for A? Short of repackaging B, one could try to work around this by adding "Requires: A" to your sample C spec file above, but the relative ordering of A and B would still be uncontrolled. Is there a way, via only C's .spec file, to coerce ordering of A and B? This is a special-case subset of OP's question, which I'm looking for clarification on.
    – JesseM
    Feb 9, 2017 at 2:36

You must log in to answer this question.

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