On Debian, installing java and elasticsearch in the same apt-get run fails #33607
Labels
:Delivery/Packaging
RPM and deb packaging, tar and zip archives, shell and batch scripts
Team:Delivery
Meta label for Delivery team
I'm using Debian 9 and elasticsearch 6.4.0. In a freshly installed Debian system I do this:
apt-get install elasticsearch openjdk-8-jre-headless
and it fails with this error:
This happens because the preinst (not the postinst) checks that java is in the PATH, and it fails if it's not, but java will not be in the PATH until we let the openjdk-8-jre-headless package to be configured, since the /usr/bin/java executable is handled via the alternatives mechanism.
I could of course install java first and then elasticsearch, in separate apt-get runs, but that would be only a workaround and not a real and elegant solution.
It would be better to tell dpkg that the java package should be configured first, and this already happens when a simple Depends is used.
Depends: openjdk-8-jre-headless | every-other-package-providing-java-8
Then the current stuff in the preinst could be moved to postinst again, where it probably belongs.
BTW: The current Depends field is not very orthodox:
Depends: bash, libc6, adduser, coreutils
Both bash and coreutils are essential, so they don't need to be there.
The dependency on libc6 is also suspicious because normally they are versioned and created automatically by dpkg-shlibdeps, and this one seems to be added by hand. If the package does not contain any ELF binary, there is no need to add a dependency on libc6.
Thanks.
The text was updated successfully, but these errors were encountered: