# Elasticsearch 7.16 failed install on Unbuntu 20.04 - cannot execute binary file

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777>\
**Category:** Elasticsearch\
**Created:** [January 7, 2022, 6:32pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777 "2022-01-07T18:32:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Winston\_Ferguson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/winston_ferguson/32/98578_2.png) [@Winston\_Ferguson](https://discuss.elastic.co/u/Winston_Ferguson)\
**Post date:** [January 7, 2022, 6:32pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777/1 "2022-01-07T18:32:50Z")

</div>

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:

```auto
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

```auto
/usr/lib/jvm/java-11-openjdk-amd64

```

java --version returns

```auto
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

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 9, 2022, 11:19pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777/2 "2022-01-09T23:19:36Z")

</div>

Welcome to our community! 😃

There's not a lot there to be honest. Is there anything in other system logs that relate to this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 10, 2022, 2:53am UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777/3 "2022-01-10T02:53:12Z")

</div>

Have a look at [this thread](https://discuss.elastic.co/t/how-do-you-configure-elasticsearch-on-ubuntu-bash-for-windows-10/194888/4) which I believe is related.

---

<div class="post-metadata">

**Author:** ![Winston\_Ferguson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/winston_ferguson/32/98578_2.png) [@Winston\_Ferguson](https://discuss.elastic.co/u/Winston_Ferguson)\
**Post date:** [January 11, 2022, 1:54pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777/4 "2022-01-11T13:54:49Z")

</div>

Thanks for the help.

I read the thread Christian linked and opted for a Windows install. Straight forward, fast, and no issues.

I had Elasticsearch installed and working via Ubuntu/WSL on my previous machine but that was Windows 10 and Intel. I'm now on Windows 11 with AMD and I'm not sure if this could affect things?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 8, 2022, 1:55pm UTC](https://discuss.elastic.co/t/elasticsearch-7-16-failed-install-on-unbuntu-20-04-cannot-execute-binary-file/293777/5 "2022-02-08T13:55:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
