Elastic has their own guide to install elasticsearch with Debian packages. you can find it on their website.
I used this one and now everything works like a charm.
Elasticsearch requires Java 8 or later:
$ sudo apt-get install openjdk-8-jdk
$ java -version
openjdk version "1.8.0_111"
$ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ sudo apt-get install apt-transport-https
$ echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
some remarks (from elastic website):
- Do not use
add-apt-repository as it will add a deb-src entry as well, but we do not provide a source package. If you have added the deb-src entry, you will see an error like the following:
Unable to find expected entry 'main/source/Sources' in Release file
Wrong sources.list entry or malformed file)
=> Delete the deb-src entry from the /etc/apt/sources.list file and the installation should work as expected.
- If two entries exist for the same Elasticsearch repository, you will see an error like this during apt-get update:
Duplicate sources.list entry
/etc/apt/sources.list.d/elasticsearch-5.x.list for the duplicate entry or locate the duplicate entry amongst the files in
/etc/apt/sources.list.d/ and the