# Installing elasticsearch with apt-get on debian

**URL:** <https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854>\
**Category:** Elasticsearch\
**Created:** [April 30, 2016, 10:05am UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854 "2016-04-30T10:05:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanbarr](https://avatars.discourse-cdn.com/v4/letter/i/8797f3/32.png) [@ivanbarr](https://discuss.elastic.co/u/ivanbarr)\
**Post date:** [April 30, 2016, 10:05am UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854/1 "2016-04-30T10:05:27Z")

</div>

Hi there,

Is anyone else having trouble installing elasticsearch on debian using apt-get?

I've set up the repo as described on the site:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html)

I installed the key

wget -qO - [https://packages.elastic.co/GPG-KEY-elasticsearch](https://packages.elastic.co/GPG-KEY-elasticsearch) | sudo apt-key add -

then the repo which you can see:

cat /etc/apt/sources.list.d/elasticsearch-2.x.list  
deb [http://packages.elastic.co/elasticsearch/2.x/debian](http://packages.elastic.co/elasticsearch/2.x/debian) stable main

I also set up repos for logstash and kibana as per instructions:

cat /etc/apt/sources.list  
  
deb [http://packages.elastic.co/logstash/2.3/debian](http://packages.elastic.co/logstash/2.3/debian) stable main

cat /etc/apt/sources.list.d/kibana-4.4.x.list  
deb [http://packages.elastic.co/kibana/4.4/debian](http://packages.elastic.co/kibana/4.4/debian) stable main

I can install logstash and kibana with apt-get install no problem but when I try to install elasticsearch it can't find the package

logstash and kibana are installed into /opt  
If I download the .deb package for elasticsearch then install it with dpkg it puts it in /usr/share. I'd like them all to be done the same way 🙂

uname -a  
Linux rowlf 3.2.0-4-686-pae #1 SMP Debian 3.2.78-1 i686 GNU/Linux  
cat /etc/debian\_version  
7.10

Any ideas?

Regards,  
Ivan

---

<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:** [April 30, 2016, 10:42am UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854/2 "2016-04-30T10:42:22Z")

</div>

What command did you use to install ES and what is the output?

---

<div class="post-metadata">

**Author:** ![ivanbarr](https://avatars.discourse-cdn.com/v4/letter/i/8797f3/32.png) [@ivanbarr](https://discuss.elastic.co/u/ivanbarr)\
**Post date:** [April 30, 2016, 12:42pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854/3 "2016-04-30T12:42:40Z")

</div>

I followed the instructions here:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html)

To capture the output uninstalled the .deb I installed manually and ran through the commands again. This might be slightly different output than the very first time I did this because the .deb was previously installed but it illustrates the point:

So step 1. I installed the key

ivan@rowlf:~$ wget -qO - [https://packages.elastic.co/GPG-KEY-elasticsearch](https://packages.elastic.co/GPG-KEY-elasticsearch) | sudo apt-key add -  
OK  
ivan@rowlf:~$

Step 2 Save the repository definition to /etc/apt/sources.list.d/elasticsearch-2.x.list:

ivan@rowlf:~$ echo "deb [http://packages.elastic.co/elasticsearch/2.x/debian](http://packages.elastic.co/elasticsearch/2.x/debian) stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list  
deb [http://packages.elastic.co/elasticsearch/2.x/debian](http://packages.elastic.co/elasticsearch/2.x/debian) stable main  
ivan@rowlf:~$ cat /etc/apt/sources.list.d/elasticsearch-2.x.list  
deb [http://packages.elastic.co/elasticsearch/2.x/debian](http://packages.elastic.co/elasticsearch/2.x/debian) stable main  
ivan@rowlf:~$

Step 3: install the package

ivan@rowlf:~$ sudo apt-get update && sudo apt-get install elasticsearch  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release.gpg  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release.gpg  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release.gpg  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release  
  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable Release  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable/main i386 Packages  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable/main i386 Packages  
Hit [http://packages.elastic.co](http://packages.elastic.co) stable/main i386 Packages  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en\_GB  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en\_GB  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en\_GB  
Ign [http://packages.elastic.co](http://packages.elastic.co) stable/main Translation-en  
Fetched 159 kB in 8s (19.8 kB/s)  
Reading package lists... Done  
Reading package lists... Done  
Building dependency tree  
Reading state information... Done  
Package elasticsearch is not available, but is referred to by another package.  
This may mean that the package is missing, has been obsoleted, or  
is only available from another source

E: Package 'elasticsearch' has no installation candidate  
ivan@rowlf:~$

After this I just downloaded the .deb directly from the site and installed it

ivan@rowlf:~$ wget [https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.2/elasticsearch-2.3.2.deb](https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.2/elasticsearch-2.3.2.deb)  
ivan@rowlf:~$ sudo dpkg -i elasticsearch-2.3.2.deb  
Selecting previously unselected package elasticsearch.  
(Reading database ... 80130 files and directories currently installed.)  
Unpacking elasticsearch (from elasticsearch-2.3.2.deb) ...  
Setting up elasticsearch (2.3.2) ...  
ivan@rowlf:~$ sudo cp elasticsearch-2.3.2.deb /var/cache/apt/archives/

Then I did this just to make sure there were no unresolved dependencies:

ivan@rowlf:~$ sudo apt-get update -f

The result is that elasticsearch is installed in /usr/share/elasticsearch

But logstash and kibana which installed successfully from apt-get are in /opt

---

<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:** [April 30, 2016, 10:25pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854/4 "2016-04-30T22:25:25Z")

</div>

> [@ivanbarr](#):
>
> Package elasticsearch is not available, but is referred to by another package.

Sounds like there may be another source somewhere interfering.

---

<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:** [July 5, 2017, 10:55pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-with-apt-get-on-debian/48854/5 "2017-07-05T22:55:03Z")

</div>


