"Requires" range

James Antill james.antill at redhat.com
Tue Sep 15 15:59:57 UTC 2015

On Tue, 2015-09-15 at 13:44 +0100, Paul wrote:
> Thanks for the quick reply, Florian! Unfortunately, neither of these work:
> >Requires: java >= 1.6
> >Conflicts: java >= 1.8
> Error: foo conflicts with 1:java-1.8.0-openjdk-
>   You could try using --skip-broken to work around the problem
>   You could try running: rpm -Va --nofiles --nodigest

 Yeh, this isn't a good way to express the range because yum will see
the requires and then find the highest matching package which satisfies
it ... and then hit the conflicts and fail.

> >Requires: java < 1.8
> >Conflicts: java < 1.6
> Error: Package: foo (bar)
>             Requires: java < 1.8
>   You could try using --skip-broken to work around the problem
>   You could try running: rpm -Va --nofiles --nodigest

 Is this all it said? Does this machine have anything that provides
"java < 1.8" ? This range should mostly work, apart from problems you'll
hit post install where yum wants to upgrade java (assuming 1.8 is
available) but the upgrade will fail.

> >This has the disadvantage you cannot install java (depending of the
> >variant used) < 1.6 or 1.8 in parallel of your package.
> That would be OK.
> >The brand new rpm 4.13 could use:
> >Requires: (java = 1.6 or java = 1.7)
> Sounds good, but I need to use the version that already comes with
> RHEL and CentOS. Thanks for your help.

 The new OR rule is basically a simpler way of using virtual provides,
so you can just do it the older more complex way:

pkgA: Requires: pkgA-java-backend

pkgA-java-backend16: Provides: pkgA-java-backend
                     Requires: java = 1.6

pkgA-java-backend17: Provides: pkgA-java-backend
                     Requires: java = 1.7

...of course you'll still hit the upgrade problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20150915/118e083f/attachment.asc>

More information about the Rpm-list mailing list