1

I have a package that I need to be compatible with openjdk 11 and oracle java 11. I'm trying to create a metapackage that can depend on openjdk java 11 or oracle java 11:

My openjdk metapackage spec is:

Name:       openjdk-11-adapter
Version:    0
Release:    0
Epoch:      0
Summary:    NA
License:    NA

Provides: java-11-metapackage
Requires: jre-11 >= 11

%description
%prep
%build
%install
%files

The oracle java metapackage spec is:

Name:       oracle-11-adapter
Version:    0
Release:    0
Epoch:      0
Summary:    NA
License:    NA

Provides: java-11-metapackage
Requires: jre  >= 2000:11

%description
%prep
%build
%install
%files

So now my package can depend on java-11-metapackage and have a dependency on either version. When I install it, I expect that yum would install whichever java is available.

What's ACTUALLY happening is that when I install my package through yum, I know that jre-11 is available through java-11-openjdk but yum will ALWAYS try to install the oracle-11-adapter and complain that there is nothing to satisfy the jre >= 2000:11 dependency. The openjdk-11-adapter is definitely known to yum, but ignored.

My question is, WHY does yum ignore the satisfiable openjdk-11-adapter, and instead try to install the unsatisfiable oracle-11-adapter? How does it determine install suitability?

I noticed that if I renamed oracle-11-adapter to aaaoracle-11-adapter, yum will behave as expected and install the java adapter whose dependencies can be satisfied, but this feels far too hacky a solution for me to put it into production.

  • consider using dnf (DaNdiFied yum) which has a better solver algorithm. – Chris Maes Sep 18 at 14:28
  • 1
    I'm sure it does, and if I was making the package for myself I'd do that, but I have end users who I need to consider. I would rather not create a hidden dependency on dnf. I appreciate you replying though! – jenny Sep 18 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.