# Installation Woes on Ubuntu/Linux

**URL:** <https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482>\
**Category:** Elasticsearch\
**Created:** [March 25, 2018, 11:50am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482 "2018-03-25T11:50:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 25, 2018, 11:50am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/1 "2018-03-25T11:50:40Z")

</div>

Tried out installing Elastic, Logstash and Kibana on Ubuntu 17.6 (running on VMWare Player on Windows 10) and it was a bit difficult. Not sure if it's because I'm not a Linux guru or what.

1. Installing elasticsearch via apt-get works but it does not run because of some YAML library missing

2. Installing manually (wget/download) works but all the permissions are wrong and it won't run without a lot of tweaking (chown).

Point 2 is the real issue and applies equally to ElasticSearch, LogStash and Kibana. It's catch 22: you can't install without sudo but if you use sudo then all the created directories are owned by root and you have no access to them so nothing runs (permission errors).

So the only way to get things running is to sudo install them and then chown 4 different folders: one for each application. So for logstash you have to do:

1. sudo chown -R myuser /usr/share/logstash
2. sudo chown -R myuser /etc/logstash
3. sudo chown -R myuser /var/lib/logstash
4. sudo chown -R myuser /var/log/logstash

Do that 3 times and you might have ELK running.

Then, when you install X-Pack you have to do similar antics.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 25, 2018, 12:29pm UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/2 "2018-03-25T12:29:41Z")

</div>

I might add that running elasticsearch itself with sudo results in (from memory) something like: "Cannot run elastic search as root".

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 25, 2018, 7:01pm UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/3 "2018-03-25T19:01:44Z")

</div>

So I got ES running but it won't run as a service. `sudo service elasticsearch start` runs without error but ES is not running.

I assume it's permissions of the elasticsearch user so I tried setting the group ownership to "adm" on all relevant folders and adding the elasticsearch user to the adm group (myuser was already a member). This has not helped issues.

Any way to diagnose why a service won't start in linux? Can't see anything in syslog or /var/log/elasticsearch/\*.log

---

<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:** [March 25, 2018, 8:55pm UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/4 "2018-03-25T20:55:01Z")

</div>

> [@cawoodm](#):
>
> Installing elasticsearch via apt-get works but it does not run because of some YAML library missing

That should not be the case. What was the error you saw?

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 26, 2018, 12:38pm UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/5 "2018-03-26T12:38:47Z")

</div>

Unfortunately I have no way of recalling the exact message but it should be reproducible on a new installation of Ubuntu 17.6 on VMWare. Just ran sudo apt-get install elasticsearch (after sudo apt-get update).

Googling the issue at the time brought up posts saying the apt-get package for elasticsearch was not quite "ready for the masses" or similar. I think basically some YAML library was missing or out of date.

I think the following link describes the error:  
[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829078](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829078)

i.e.

> Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/common/jackson/dataformat/yaml/snakeyaml/error/YAMLException

---

<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:** [March 26, 2018, 8:16pm UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/6 "2018-03-26T20:16:32Z")

</div>

> [@cawoodm](#):
>
> Googling the issue at the time brought up posts saying the apt-get package for elasticsearch was not quite "ready for the masses" or similar.

There's been 200 million or so downloads of our product and I don't recall seeing this problem in the last few years. Not trying to put the blame on you, but it's super helpful if you can record things so we can dig deeper and find a solution.

Also it doesn't actually look like Ubuntu 17 has been released?

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 27, 2018, 9:46am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/7 "2018-03-27T09:46:07Z")

</div>

It may well have been Ubuntu 17.10 which is released here:  
[https://www.ubuntu.com/download/desktop](https://www.ubuntu.com/download/desktop)

The experience was written "posthumously" after I'd gotten things running and I thought I'd let you guys know but I'm fairly certain the link I posted is the correct error message "NoClassDefFoundError".

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [March 29, 2018, 6:19am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/8 "2018-03-29T06:19:47Z")

</div>

What version of elasticsearch are you installing? That Debian bug link is for a very old version (1.7) and trying to install from that repository on a recent distro would likely have many issues. See the current docs for [installing on Debian systems](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html).

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 29, 2018, 9:26am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/9 "2018-03-29T09:26:16Z")

</div>

I actually did follow the guide you linked BUT I'll admit that I skipped the following steps:

- "Import the Elasticsearch PGP Keyedit"
- The first 2 steps under "Installing from the APT repository"

I did not specify a version, I just did "apt-get install elasticsearch".

As I said I'm a noob and I assumed apt-get would install the latest version. Perhaps what is missing was this:

> echo "deb [https://artifacts.elastic.co/packages/6.x/apt](https://artifacts.elastic.co/packages/6.x/apt) stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list

Would that tell apt-get the correct version? I had assumed apt-get was a centralized repo like npm.

---

<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:** [April 26, 2018, 9:26am UTC](https://discuss.elastic.co/t/installation-woes-on-ubuntu-linux/125482/10 "2018-04-26T09:26:17Z")

</div>

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