Skip to content

Debian package needs java dependency #31845

@stumyp

Description

@stumyp

Elasticsearch version: 6.3.1

Plugins installed: []

JVM version: any

OS version Debian or Ubuntu

Description of the problem including expected versus actual behavior:

elasticsearch debian package must list dependency on java runtime.
Both Debian and Ubuntu have the same names for default java runtimes.
current Depends field looks like this:

Depends: bash, libc6, adduser, coreutils

while it should look like something like this:

Depends: bash, libc6, adduser, coreutils, openjdk-10-jre-headless | openjdk-8-jre-headless | java8-runtime-headless | java8-runtime | java10-runtime-headless | java10-runtime

If people want to use different version of java, they can always use update-alternatives command to update default version.

Steps to reproduce:

let's say you have apt sources configured.
simple install never worked, but now it also fails before it even tries to unpack:

root@69db9738979c:/# apt install elasticsearch                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.4 MB of archives.
After this operation, 143 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/6.x/apt stable/main amd64 elasticsearch all 6.3.1 [91.4 MB]
Fetched 91.4 MB in 4s (22.3 MB/s)        
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package elasticsearch.
(Reading database ... 7273 files and directories currently installed.)
Preparing to unpack .../elasticsearch_6.3.1_all.deb ...
dpkg: error processing archive /var/cache/apt/archives/elasticsearch_6.3.1_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/elasticsearch_6.3.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

OK, since that never worked, I install desired openjdk version together with elasticsearch, and it used to work before:

root@69db9738979c:/# apt install openjdk-8-jre-headless elasticsearch
<skip long installation log>
dpkg: error processing archive /tmp/apt-dpkg-install-9DAxH4/33-elasticsearch_6.3.1_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /tmp/apt-dpkg-install-9DAxH4/33-elasticsearch_6.3.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

so it still ends with error, also leaving all java packages unconfigured.
It works only if I install java runtime separately, before elasticsearch

This happens because elasticsearch package doesn't have direct dependency on jre. If there is one, package manager would configure jre before trying to unpack elasticsearch.

Metadata

Metadata

Labels

:Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scriptsTeam:DeliveryMeta label for Delivery team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions