# Error in installing elasticsearch 6.7 and above

**URL:** https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980
**Category:** Elasticsearch
**Created:** [May 14, 2019, 10:29am UTC](https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980 "2019-05-14T10:29:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Vikash\_Singh1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikash_singh1/32/42119_2.png) [@Vikash\_Singh1](https://discuss.elastic.co/u/Vikash_Singh1)
#### Post date: [May 14, 2019, 10:29am UTC](https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980/1 "2019-05-14T10:29:45Z")

</div>

While installing elaticsearch 6.7 and above I am getting this error:  
sudo systemctl start elasticsearch.service  
could not find java in JAVA\_HOME or bundled at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7\_6.x86\_64/jre/bin/java/bin/java  
chown: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory  
chmod: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory  
md5sum: /etc/elasticsearch/elasticsearch.keystore: No such file or directory  
warning: %posttrans(elasticsearch-0:7.0.1-1.x86\_64) scriptlet failed, exit status 1  
Also When I try to start elasticsearch it gives an error

---

<div class="post-metadata">

### Author: ![Andrew\_Griffiths](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@Andrew\_Griffiths](https://discuss.elastic.co/u/Andrew_Griffiths)
#### Post date: [May 31, 2019, 7:27am UTC](https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980/2 "2019-05-31T07:27:22Z")

</div>

I also have this error on one of my nodes when upgrading from 6.6 to 6.8 looks like something goes wrong during the upgrade

> Running transaction check  
> Running transaction test  
> Transaction test succeeded  
> Running transaction  
> Creating elasticsearch group... OK  
> Creating elasticsearch user... OK  
> Installing : elasticsearch-6.8.0-1.noarch \> 1/1  
> NOT starting on installation, please execute the following statements to configure  
> elasticsearch service to start automatically using systemd  
> sudo systemctl daemon-reload  
> sudo systemctl enable elasticsearch.service  
> You can start elasticsearch service by executing  
> sudo systemctl start elasticsearch.service  
> A tool for managing settings stored in the elasticsearch keystore  
> Commands  
> create - Creates a new elasticsearch keystore  
> list - List entries in the keystore  
> add - Add a string setting to the keystore  
> add-file - Add a file setting to the keystore  
> remove - Remove a setting from the keystore  
> Non-option arguments:  
> command  
> Option Description
> 
> * * *
> 
> -h, --help show help  
> -s, --silent show minimal output  
> -v, --verbose show verbose output  
> ERROR: Unknown command [upgrade]  
> warning: %posttrans(elasticsearch-0:6.8.0-1.noarch) scriptlet failed, exit status 64  
> Non-fatal POSTTRANS scriptlet failure in rpm package elasticsearch-6.8.0-1.noarch  
> Verifying : elasticsearch-6.8.0-1.noarch \> 1/1

Installed:  
elasticsearch.noarch 0:6.8.0-1

Complete!

then I get this when I try to start the service  
elasticsearch.service - Elasticsearch  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Thu 2019-05-30 20:51:47 BST; 11h ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Main PID: 21319 (code=exited, status=1/FAILURE)

May 30 20:51:36 node3 systemd[1]: Started Elasticsearch.  
May 30 20:51:47 node3 elasticsearch[21319]: Exception in thread "main" java.lang.AssertionError: Lucene version mismatch this version of Elasticsearch requires lucene version [7.6.0] but the current lucene version is [7.7.0]  
May 30 20:51:47 node3 systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE  
May 30 20:51:47 node3 systemd[1]: Unit elasticsearch.service entered failed state.  
May 30 20:51:47 node3 systemd[1]: elasticsearch.service failed.

---

<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: [June 28, 2019, 7:27am UTC](https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980/3 "2019-06-28T07:27:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![PhaedrusTheGreek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phaedrusthegreek/32/4884_2.png) [@PhaedrusTheGreek](https://discuss.elastic.co/u/PhaedrusTheGreek)
#### Post date: [November 14, 2019, 3:11pm UTC](https://discuss.elastic.co/t/error-in-installing-elasticsearch-6-7-and-above/180980/4 "2019-11-14T15:11:06Z")

</div>

As of Elasticsearch 7, we include [a bundled JDK](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/setup.html). You can specify your own JDK via `JAVA_HOME`, but that [doesn't seem to work](https://github.com/elastic/elasticsearch/issues/49068). Try unsetting the `JAVA_HOME` environment variable - in my CentOS system it was found in `/etc/environment` aside from the usual culprits.
