Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Debian, installing java and elasticsearch in the same apt-get run fails #33607

Closed
sanvila opened this issue Sep 11, 2018 · 2 comments
Closed
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team

Comments

@sanvila
Copy link

sanvila commented Sep 11, 2018

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:

dpkg: error processing archive /var/cache/apt/archives/elasticsearch_6.4.0_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/elasticsearch_6.4.0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

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.

@colings86 colings86 added the :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts label Sep 11, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@jasontedor
Copy link
Member

Thanks for the well-written summary, and sorry for the trouble. This is effectively covered under #31845, work that we plan to do. As such, I hope you do not mind at all that I close this.

cc @dliappis for more background on #31845.

@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests

5 participants