Hi,
I'm unable to solve my issue installing Elasticsearch on my new Windows 11 machine running Ubuntu 20.04 (via Windows Subsystem for Linux). The log received is:
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 32 not upgraded.
Need to get 344 MB of archives.
After this operation, 552 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.16.2 [344 MB]
Fetched 344 MB in 17min 56s (319 kB/s)
(Reading database ... 61463 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.16.2_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: line 20: .: /etc/default/elasticsearch: cannot execute binary file
dpkg: error processing archive /var/cache/apt/archives/elasticsearch_7.16.2_amd64.deb (--unpack):
new elasticsearch package pre-installation script subprocess returned error exit status 126
Errors were encountered while processing:
/var/cache/apt/archives/elasticsearch_7.16.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Having looked into things online, I figured this might be an issue with my Java install or JAVA_HOME environment variable but these seem okay:
echo $JAVA_HOME returns
/usr/lib/jvm/java-11-openjdk-amd64
java --version returns
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
Any insight as to where the issue may be and how to solve it would be greatly appreciated.
Thanks