# Installing x-pack with nonstandard CONF\_DIR

**URL:** <https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448>\
**Category:** Elasticsearch\
**Created:** [February 24, 2017, 9:34pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448 "2017-02-24T21:34:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkTierney](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@MarkTierney](https://discuss.elastic.co/u/MarkTierney)\
**Post date:** [February 24, 2017, 9:34pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448/1 "2017-02-24T21:34:03Z")

</div>

Hi Folks,

My 5.2 elasticsearch.yml is in a non standard folder on my ubuntu system. The doc for x-pack package install, [https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-package-installation](https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-package-installation), indicates that you should be able to set the CONF\_DIR or JAVA\_OPTS to work around this for the install.

I had assumed this meant setting the system variable and exporting it before running: sudo -E bin/elasticsearch-plugin install x-pack. Unfortunately that doesn't seem to be the case. I've tried several permutations of this and I always get:

Unable to source environment file: //etc/default/elasticsearch

What am I not interpreting correctly here? Should I be setting other system variables?

Thanks, Mark

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 24, 2017, 10:14pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448/2 "2017-02-24T22:14:51Z")

</div>

Hey,

can you verify that the environment variables you are setting are available in the `sudo` call?  
Also, can you provide full commands, that you tried, so we can see what happens?

--Alex

---

<div class="post-metadata">

**Author:** ![MarkTierney](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@MarkTierney](https://discuss.elastic.co/u/MarkTierney)\
**Post date:** [February 27, 2017, 1:48pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448/3 "2017-02-27T13:48:16Z")

</div>

Thanks,

This is what I have attempted:

export CONF\_DIR=/etc/elasticsearch/node1  
cd /usr/share/elasticsearch  
sudo bin/elasticsearch-plugin install x-pack

returns:  
bin/elasticsearch-plugin: line: 48 //etc/default/elasticsearch: Nos such file or directory  
Unable to source environment file: //etc/defaul/elasticserach

setting the CONF\_DIR and then executing sudo echo $CONF\_DIR returns the value I set

---

<div class="post-metadata">

**Author:** ![MarkTierney](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@MarkTierney](https://discuss.elastic.co/u/MarkTierney)\
**Post date:** [February 27, 2017, 3:04pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448/4 "2017-02-27T15:04:18Z")

</div>

Hi Alex,

OK, figured this out by looking at the **/usr/share/elasticsearch/bin/elasticsearch-plugin** script. The error was pointing to the default environmental file that is usually called: /etc/default/elasticsearch. The CONF\_DIR or JAVA\_OPTS did not work out for me but after viewing the plugin script, I found that I could export ES\_INCLUDE with the correct value for my environment **/etc/default/node1\_elasticsearch** (ansible created) and the subsequent command:

sudo -E bin/elasticsearch-plugin install x-pack succeeds!.

Thanks again for the help!

---

<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:** [March 27, 2017, 3:04pm UTC](https://discuss.elastic.co/t/installing-x-pack-with-nonstandard-conf-dir/76448/5 "2017-03-27T15:04:31Z")

</div>

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