Strange Behaviour Of Yum Within %post In Kickstart

Home » CentOS » Strange Behaviour Of Yum Within %post In Kickstart
CentOS No Comments


(This is happening on CentOS 6)

during a machine’s kickstart I install several yum repositories which are contained in an RPM. During the %post phase I install an RPM which has a dependency to nodejs. That package with all of its dependencies can be found in EPEL. On the other hand I have the Softwarecollections repository, which also contains nodejs with the same version.

Now nodejs has a dependency on libuv:

| root@devcma01 ~ # yum deplist nodejs -q –disableexcludes=all
| […]
| dependency:
| provider: nodejs010-libuv.x86_64 1:0.10.30-1.el6
| provider: libuv.x86_64 1:0.10.34-1.el6
| provider: libuv.x86_64 1:0.10.34-1.el6

As you can see, there are two packages satisfying the dependency.

First strange behaviour:

| root@devcma01 ~ # yum –disableexcludes=all -v -d9 install nodejs
| […]
| nodejs-0.10.48-3.el6.x86_64 requires:
| –> Processing Dependency: for package:
| Searching pkgSack for dep:
| Building updates object
| up:simple updates time: 0.010
| up:obs time: 0.014
| up:condense time: 0.000
| updates time: 1.059
| TSINFO: Marking 1:nodejs010-libuv-0.10.30-1.el6.x86_64 as install for nodejs-0.10.48-3.el6.x86_64
| […]

Why is nodejs010-libuv winning over libuv? It has the longer name *and* an inferior version number. Does the amount of “requires” play a role here?

| root@devcma01 ~ # repoquery –requires libuv | wc -l
| 32
| root@devcma01 ~ # repoquery –requires nodejs010-libuv | wc -l
| 15

The solution seems easy: Exclude nodejs010 from softwarecollections:

| root@devcma01 /etc/yum.repos.d # grep exclude= *
| python27.repo:exclude=nodejs010*

Now comes the other strange behaviour. As said: I install that repository during kickstart and then a package gets installed (within %post) that needs nodejs. The installed repo file has the “exclude” line in it. But:

| –> Processing Dependency: nodejs for package:
| —> Package nodejs.x86_64 0:0.10.48-3.el6 will be installed
| –> Processing Dependency: for package:
| —> Package nodejs010-libuv.x86_64 1:0.10.30-1.el6 will be installed

It is as if the exclude line isn’t even honoured within the %post section of kickstart. Any idea on why that is?