0

I want to install pdftk on my development machine where I have installed (multiple versions of) Java with SDKMAN!. In order to fulfill the dependency on default-jre-headless of pdftk-java, I created a simple file for equivs-build:

Section: misc
Priority: optional
Homepage: https://github.com/reitzig/sdkman-equivs
Standards-Version: 3.9.2

Package: sdkman-java-11-open
Maintainer: Raphael Reitzig <4246780+reitzig@users.noreply.github.com>
Provides: openjdk-11-jre-headless, openjdk-11-jdk-headless, openjdk-11-source, default-jdk-headless, default-jre-headless
Conflicts: openjdk-11-jre-headless, openjdk-11-jdk-headless, openjdk-11-source
Replaces: openjdk-11-jre-headless, openjdk-11-jdk-headless, openjdk-11-source
Architecture: all
Description: Dummy package for OpenJDK 11 installed with SDKMAN!

I then installed the package with

equivs-build java-11-open
sudo dpkg -i sdkman-java-11-open_1.0_all.deb

Seems to have worked:

$ aptitude show default-jre-headless
Package: default-jre-headless            
<snip>
Provided by: sdkman-java-11-open (1.0)

However, the dependency is still not met:

$ sudo aptitude update > /dev/null; sudo aptitude install pdftk
The following NEW packages will be installed:
  default-jre-headless{a} java-common{a} libapache-pom-java{a} libbcprov-java{a} libcommons-lang3-java{a} 
  libcommons-parent-java{a} pdftk pdftk-java{a}

Same with apt-get. This is on Ubuntu 18.04.

What have I done wrong?

1

David Foerster’s pdftk-java package depends on default-jre-headless (>= 7) | java7-runtime-headless; to satisfy that, you need a package with a versioned “Provides” (for default-jre-headless), or a package providing java7-runtime-headless. (I think the versioned dependency on default-jre-headless is incorrect; the default JDK/JRE packages are concrete packages with an epoch, so they all match that, and they’re not supposed to be used to enforce minimal versions.)

You should change your equivs file to provide the same virtual packages as the packages you’re replacing (openjdk-11-jre-headless etc.), with at least:

Provides: java-runtime-headless, java10-runtime-headless, java11-runtime-headless, java2-runtime-headless, java5-runtime-headless, java6-runtime-headless, java7-runtime-headless, java8-runtime-headless, java9-runtime-headless, openjdk-11-jre-headless, openjdk-11-jdk-headless, openjdk-11-source, default-jdk-headless, default-jre-headless

(You probably don’t need to provide the concrete openjdk-11-jre-headless and openjdk-11-jdk-headless packages, but I’ve left them in for simplicity.)

  • I saw this long list of provided packages, which doesn't make a lot of sense to me: a Java 11 runtime does not double as a Java 7 runtime! But it seems it has to be this way (for now). Thanks! – Raphael Jan 4 at 11:07
  • I agree on the dependency. default-jre-headless has version 2:1.10-... in the repos; >= 7 seems inconsistent. It should probably be java7-runtime-headless | java8-runtime-headless | java9-runtime-headless | java10-runtime-headless | java11-runtime-headless. At least, that seems to be the intent. – Raphael Jan 4 at 11:09
  • More to the point: since openjdk-11-jre-headless provides all the java_0runtime-headless, I thought providing the single, specific package would to the trick. Are provides not recursive? – Raphael Jan 4 at 11:11
  • 1
    No, provides aren’t transitive. – Stephen Kitt Jan 4 at 11:14
  • 1
    To clarify this further, “Provides” is intended (at its core) for virtual packages, so there’s nothing to anchor transitive dependencies on. – Stephen Kitt Jan 4 at 11:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.