Unable to install elasticsearch with apt

I've followed the instructions on https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
but when I run apt-get update followed by apt-get install elasticsearch, I get a 'Unable to locate package' error.

apt-get update has the following output:
apt-get update Hit http://ppa.launchpad.net trusty InRelease Hit http://ppa.launchpad.net trusty/main i386 Packages Hit http://ppa.launchpad.net trusty/main Translation-en Ign http://archive.ubuntu.com trusty InRelease Ign http://packages.elastic.co stable InRelease Ign http://apt.puppetlabs.com trusty InRelease Hit http://packages.elastic.co stable Release.gpg Get:1 http://archive.ubuntu.com trusty-updates InRelease [64.4 kB] Hit http://apt.puppetlabs.com trusty Release.gpg Hit http://packages.elastic.co stable Release Hit http://apt.puppetlabs.com trusty Release Hit http://packages.elastic.co stable/main i386 Packages Hit http://apt.puppetlabs.com trusty/main Sources Hit http://apt.puppetlabs.com trusty/dependencies Sources Hit http://archive.ubuntu.com trusty-backports InRelease Hit http://apt.puppetlabs.com trusty/main i386 Packages Get:2 http://archive.ubuntu.com trusty-security InRelease [64.4 kB] Hit http://apt.puppetlabs.com trusty/dependencies i386 Packages Hit http://archive.ubuntu.com trusty Release.gpg Get:3 http://archive.ubuntu.com trusty-updates/main i386 Packages [669 kB] Ign http://packages.elastic.co stable/main Translation-en_GB Ign http://packages.elastic.co stable/main Translation-en Get:4 http://archive.ubuntu.com trusty-updates/restricted i386 Packages [15.6 kB] Get:5 http://archive.ubuntu.com trusty-updates/universe i386 Packages [335 kB] Get:6 http://archive.ubuntu.com trusty-updates/multiverse i386 Packages [13.2 kB] Get:7 http://archive.ubuntu.com trusty-updates/main Translation-en [350 kB] Get:8 http://archive.ubuntu.com trusty-updates/multiverse Translation-en [6,832 B] Get:9 http://archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B] Ign http://apt.puppetlabs.com trusty/dependencies Translation-en_GB Get:10 http://archive.ubuntu.com trusty-updates/universe Translation-en [176 kB] Ign http://apt.puppetlabs.com trusty/dependencies Translation-en Hit http://archive.ubuntu.com trusty-backports/main i386 Packages Ign http://apt.puppetlabs.com trusty/main Translation-en_GB Hit http://archive.ubuntu.com trusty-backports/restricted i386 Packages Ign http://apt.puppetlabs.com trusty/main Translation-en Hit http://archive.ubuntu.com trusty-backports/universe i386 Packages Hit http://archive.ubuntu.com trusty-backports/multiverse i386 Packages Hit http://archive.ubuntu.com trusty-backports/main Translation-en Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en Hit http://archive.ubuntu.com trusty-backports/universe Translation-en Get:11 http://archive.ubuntu.com trusty-security/main i386 Packages [389 kB] Get:12 http://archive.ubuntu.com trusty-security/restricted i386 Packages [12.7 kB] Get:13 http://archive.ubuntu.com trusty-security/universe i386 Packages [123 kB] Get:14 http://archive.ubuntu.com trusty-security/multiverse i386 Packages [4,976 B] Get:15 http://archive.ubuntu.com trusty-security/main Translation-en [228 kB] Get:16 http://archive.ubuntu.com trusty-security/multiverse Translation-en [2,437 B] Get:17 http://archive.ubuntu.com trusty-security/restricted Translation-en [3,206 B] Get:18 http://archive.ubuntu.com trusty-security/universe Translation-en [72.1 kB] Hit http://archive.ubuntu.com trusty Release Hit http://archive.ubuntu.com trusty/main i386 Packages Hit http://archive.ubuntu.com trusty/restricted i386 Packages Hit http://archive.ubuntu.com trusty/universe i386 Packages Hit http://archive.ubuntu.com trusty/multiverse i386 Packages Hit http://archive.ubuntu.com trusty/main Translation-en_GB Hit http://archive.ubuntu.com trusty/main Translation-en Hit http://archive.ubuntu.com trusty/multiverse Translation-en_GB Hit http://archive.ubuntu.com trusty/multiverse Translation-en Hit http://archive.ubuntu.com trusty/restricted Translation-en_GB Hit http://archive.ubuntu.com trusty/restricted Translation-en Hit http://archive.ubuntu.com trusty/universe Translation-en_GB Hit http://archive.ubuntu.com trusty/universe Translation-en Fetched 2,534 kB in 11s (216 kB/s) Reading package lists... Done

Inspecting /var/lib/apt/lists/packages.elastic.co_elasticsearch_2.x_debian_dists_stable_main_binary-i386_Packages shows an empty file.

my sources.list file for elasticsearch has the following contents:
deb http://packages.elastic.co/elasticsearch/2.x/debian stable main
I'm running on:
Ubuntu 14.04.3 LTS
Linux eonwyn 3.13.0-77-generic #121-Ubuntu SMP Wed Jan 20 10:50:59 UTC 2016 i686 i686 i686 GNU/Linux

Any idea's how to fix this?

I have not had this problem on Ubuntu 14. My advice is to closely follow the instructions in the link you gave. In particular use the echo method as described to add the repo, this should work fine.
Good luck!

I was using ansible to add the repository to sources.list.d, however removing that entry, and repeating the procedure manually had the same effect: no package found and an empty packages file in the /var/lib/apt/lists directory. That in combination with the Ign entries in the output of apt-get update would indicate to me a problem with the package repository at that address. Trying a curl delivers this output:
`$ curl -L http://packages.elastic.co/elasticsearch/2.x/debian/stable/main/binary-i386/Packages

<?xml version="1.0" encoding="UTF-8"?>

NoSuchKeyThe specified key does not exist.elasticsearch/2.x/debian/stable/main/binary-i386/Packages727B77BCEA448783RFE8WO0kOtpnPGsCPW5fIVpbmdM0nYqlOuhyZLl7wwKgmZM/ohCokgLu6DPtFUxt4IqxUUgH2IM=`

This is the URL that APT is using to collect the Package metadata (which is empty) so it looks to me like there is a problem with the package URL supplied in the documentation. Can anyone confirm this on their machines?

Okay, I think I've managed to track down the problem: The previous curl should have been:
curl -L http://packages.elastic.co/elasticsearch/2.x/debian/dists/stable/main/binary-i386/Packages

Only this returns an empty file.
Checking the output from release shows that this is in fact the case:
$ curl -L http://packages.elastic.co/elasticsearch/2.x/debian/dists/stable/Release Codename: stable Date: Tue, 02 Feb 2016 09:05:19 UTC Architectures: amd64 i386 Components: main Suite: MD5Sum: ff29ccdc765d744e3b361571566ca8f2 8111 main/binary-amd64/Packages 9a7ba5ba3eec743e2e84dd7d11372742 1498 main/binary-amd64/Packages.gz d41d8cd98f00b204e9800998ecf8427e 0 main/binary-i386/Packages ef42239d53bc4460b51f505976ce1711 20 main/binary-i386/Packages.gz SHA1: 7f954350ae86f9ed69b1496f7bee9ceb687cb969 8111 main/binary-amd64/Packages 689d698b03ac205f41989c9bbd0f930cb9af40ca 1498 main/binary-amd64/Packages.gz da39a3ee5e6b4b0d3255bfef95601890afd80709 0 main/binary-i386/Packages 58b67523c5bc3a032612115dc393ad8c3ac89bde 20 main/binary-i386/Packages.gz SHA256: 53b909fbc68bb5f08a856bd9f33806f6ea42e0489a80e918d3bd3d181b928ec8 8111 main/binary-amd64/Packages bb4d43acd1ea538e3866577719de3475a586d5fea48592e64c5dcd92b296dae5 1498 main/binary-amd64/Packages.gz e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 main/binary-i386/Packages 79489eae2467a4336df8c505bd176ae673791b1df91dd9dc4893e2149f1e6c6c 20 main/binary-i386/Packages.gz
There are no i386 binaries in the Package repository. And for reasons which escape me, but have something to do with the age of the server I'm attempting to do this install on, I have a 32 bit Ubuntu installation.

So there you have it people, Elasticsearch simply will not install on a 32 bit ubuntu. This should probably be added to the support matrix, if anyone from Elastic is reading this. Not that I blame them, I mean seriously? 32 bit computing in 2016? I'm nuts.

1 Like

Yes, that's pretty weird indeed.
:slight_smile:

We do not support 32 bit sorry :frowning:

You're right that we should make that more explicit, I'll see what we can do!