# Install elasticsearch 6.5.1 on Debian 9 fails with sudo dpkg -i elasticsearch-6.5.1.deb

**URL:** <https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781>\
**Category:** Elasticsearch\
**Created:** [November 29, 2018, 2:41pm UTC](https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781 "2018-11-29T14:41:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanislas](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Stanislas](https://discuss.elastic.co/u/Stanislas)\
**Post date:** [November 29, 2018, 2:41pm UTC](https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781/1 "2018-11-29T14:41:53Z")

</div>

$ sudo dpkg -i elasticsearch-6.5.1.deb  
(Reading database ... 59595 files and directories currently installed.)  
Preparing to unpack elasticsearch-6.5.1.deb ...  
dpkg: error processing archive elasticsearch-6.5.1.deb (--install):  
subprocess new pre-installation script returned error exit status 1  
Errors were encountered while processing:  
elasticsearch-6.5.1.deb

---

<div class="post-metadata">

**Author:** ![Stanislas](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Stanislas](https://discuss.elastic.co/u/Stanislas)\
**Post date:** [November 29, 2018, 2:50pm UTC](https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781/2 "2018-11-29T14:50:58Z")

</div>

need install it before ...

$ sudo aptitude install openjdk-8-jdk-headless net-tools wget

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [November 29, 2018, 3:04pm UTC](https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781/3 "2018-11-29T15:04:46Z")

</div>

Indeed. This is a nasty problem that we have because we make one `deb` and one `rpm`, but al of the `deb` and `rpm` distributions have their own unique ways of depending on java so we don't declare java as a dependency. That was just annoying for years, but it is actively nasty now that we use java in the preinst phase. I'm sorry for this.

---

<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:** [December 27, 2018, 3:04pm UTC](https://discuss.elastic.co/t/install-elasticsearch-6-5-1-on-debian-9-fails-with-sudo-dpkg-i-elasticsearch-6-5-1-deb/158781/4 "2018-12-27T15:04:53Z")

</div>

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