2

I need to install an application that has 4 dependencies (output from .spec file):

Requires: PA-KBU-KBUONE-SHARED
Requires: PA-KBU-KBUONE-PLI-CONF
Requires: PA-KBU-KBUONE-PLA-CONF
Requires: PA-KBU-KBUONE-PLA-BIN

These 4 dependencies must be installed in that order (first SHARED, second PLI-CONF etc), but when I do yum install app, yum does a sort on that list:

Installing:
app                             noarch            10.0.0-1              localrepo            1.4 k
Installing for dependencies:
PA-KBU-KBUONE-PLA-BIN             noarch            10.0.0-1            localrepo             20 M
PA-KBU-KBUONE-PLA-CONF            noarch            10.0.0-1            localrepo            2.5 M
PA-KBU-KBUONE-PLI-CONF            noarch            10.0.0-1            localrepo             10 k
PA-KBU-KBUONE-SHARED              noarch            10.0.0-1            localrepo            7.1 k

Is there a way to control the order in which yum installs dependencies ?

ady8531
  • 131
  • 1
  • 5
  • 2
    I'm not aware of a way of controlling this at run time. Wouldn't the best way to fix this be to declare this ordering explicitly by having requires statements in the required package spec files? – Paul Haldane Nov 11 '14 at 08:35
  • I have the same problem (in CentOS 7) but no solution yet. It is good to know about the lexigraphic ordering, but unlike the answers below saying "yum will do the right thing" - not if one of the packages is 3rd party, and doesn't correctly list all its requirements explicitly. I know what it needs, and I want to make my package load the 3rd party's missing dependency package first, then the 3rd party package. – JesseM Feb 02 '17 at 03:01

2 Answers2

1

Neither the SPEC file nor yum has any (command line) switches to determine order in which the dependencies are installed as far as I know. I think typically they end up in lexicographic order.

The only requirement with regard to dependencies is usually that they have to be met before the package that is dependent on them can be installed. If order is required and matters you're probably doing something wrong and it is not a dependency problem in the app package.

To force order automatically you have only have option really:

  • include the correct dependencies in those packages that themselves are dependencies as well i.e.
    PA-KBU-KBUONE-PLI-CONF requires PA-KBU-KBUONE-SHARED
    PA-KBU-KBUONE-PLA-CONF requires PA-KBU-KBUONE-PLI-CONF etc.
    and generate a dependency chain that way.

Of course you always manually arrange them in the correct order, either install packages sequentially and typically when multiple packages are selected on a single yum command line, they're also installed in that order.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
0

I can tell that you didn't actually install the packages, or you would not have asked this question.

Generally, yum gets this right already, installing dependencies before the package that requires them. It is only when listing the packages to be installed that they are sorted, for convenience.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972