lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
dpkg -l | grep openjdk
ii openjdk-11-jdk 11+28-0custom0 all OpenJDK Development kit (JDK) using Hotspot
ii openjdk-11.0.2+9 11.0.2+9 amd64 OpenJDK 11.0.2+9
我已经从此站点获取了 OpenJDK (build 11.0.3+7) 的源代码,并创建了一个 Debian 软件包。我已将 puppet 配置为在 pup 运行时安装 OpenJDK,但出于某种原因,它试图覆盖安装在我主机上的另一个 Java 11 版本中的文件。
我收到以下木偶错误。
Error: /Stage[main]/Java::Java1103-7/Package[openjdk-11.0.3+7]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get q -y -o DPkg::Options::=-force-confold install openjdk-11.0.3+7' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
openjdk-11.0.3+7
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 586 MB of archives.
After this operation, 839 MB of additional disk space will be used.
Get:1 http://oppa.ocado.com/dsi/ trusty/ocado openjdk-11.0.3+7 all 11.0.3+7-0custom0 [586 MB]
Fetched 586 MB in 18s (31.5 MB/s)
(Reading database ... 61775 files and directories currently installed.)
Preparing to unpack .../openjdk-11.0.3+7_11.0.3+7-0custom0_all.deb ...
Unpacking openjdk-11.0.3+7 (11.0.3+7-0custom0) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-11.0.3+7_11.0.3+7-0custom0_all.deb (--unpack):
trying to overwrite '/usr/lib/jvm/jdk-11+28/man/man1/jdeps.1', which is also in package openjdk-11-jdk 11+28-0custom0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/openjdk-11.0.3+7_11.0.3+7-0custom0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我可以通过使用强制覆盖选项手动解决此问题。
dpkg -i --force-overwrite '/var/cache/apt/archives/openjdk-11.0.3+7_11.0.3+7-0custom0_all.deb'
OpenJDK 11.0.3+7 包中是否存在导致此问题的错误?
答案1
我让它工作了。
问题的根本原因...当我在名为 javainstall 的文件夹中创建包时。有两个未打包的包 11U28 和 OpenJDK,它们位于单独的子文件夹中。RPM 使用 11U28 和 OpenJDK11 包一起创建包,因此它试图覆盖另一个包中的文件。我按如下方式修复了它...
Make sub folder under javainstall
mkdir OpenJDK1137
cd OpenJDK1137
tar -xzfv ~/Downloads/OpenJDK11U-x64_linux_11.0.3_7.tar.gz
Create the package again
fpm -n openjdk-11.0.3+7 \
-v 11.0.3+7-0custom0 \
-a all \
--vendor openjdk \
-C /home/nadeem/tmp/javainstall \
-m "Any meaningful description <[email protected]>" \
-t deb \
-s dir \
--description "OpenJDK 11.0.3+7" \
--url 'https://api.adoptopenjdk.net/v2/info/releases/openjdk11' \
--prefix /usr/lib/jvm
Confirm it only has the java version I want.
dpkg -c openjdk-11.0.3+7_11.0.3+7-0custom0_all.deb
我之前只创建过一次包,但我不知道它会这样做。