我想要安装pdftk在我的开发机器上,我安装了(多个版本的)JavaSDKMAN!。为了满足对default-jre-headless
的依赖pdftk-java
,我已创建一个简单的文件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 <[email protected]>
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!
然后我安装了这个包
equivs-build java-11-open
sudo dpkg -i sdkman-java-11-open_1.0_all.deb
似乎已经奏效:
$ aptitude show default-jre-headless
Package: default-jre-headless
<snip>
Provided by: sdkman-java-11-open (1.0)
然而,依赖关系仍然没有得到满足:
$ 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}
与 相同apt-get
。这是在 Ubuntu 18.04 上。
我做错了什么?
答案1
David Foerster 的pdftk-java
软件包取决于default-jre-headless (>= 7) | java7-runtime-headless
;为了满足这一点,你需要一个带有版本化的“提供”(针对default-jre-headless
),或提供 的包java7-runtime-headless
。 (我认为版本依赖default-jre-headless
是不正确的;默认的 JDK/JRE 包是带有纪元的具体包,因此它们都匹配,并且它们不应该用于强制执行最小版本。)
您应该更改equivs
文件以提供与要替换的包(等)相同的虚拟包openjdk-11-jre-headless
,至少:
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
(您可能不需要提供具体内容openjdk-11-jre-headless
和openjdk-11-jdk-headless
包,但为了简单起见,我将它们保留在其中。)