Using the instructions over on the ElasticSearch documentation site, in theory, you should be able to install ElasticSearch using their apt repository with very little fuss.
However when trying this myself I encountered an issue with the repository configuration.
Step 1: Download and install the Public Signing Key
wget -qO - https://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
Step 2: Add the source to apt
sudo add-apt-repository "deb https://packages.elasticsearch.org/elasticsearch/1.4/debian stable main"
Step 3: Update apt and install ElasticSearch
sudo apt-get update && sudo apt-get install elasticsearch
At this point this is where I encountered
Unable to find expected entry 'main/source/Sources'
This is thankfully very simple to fix. Edit your
/etc/apt/sources.list and remove the line like:
deb-src https://packages.elasticsearch.org/elasticsearch/1.4/debian stable main
note the version number will change over time