Hello, I have trouble installing Elasticsearch v2.x on ubuntu 18.04. Here's the output I get with the simplest case:
vik@ubuntu:~$ curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
OK
vik@ubuntu:~$ cat /etc/apt/sources.list.d/elastic-2.x.list
deb https://artifacts.elastic.co/packages/2.x/apt stable main
vik@ubuntu:~$ sudo apt update
Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://ua.archive.ubuntu.com/ubuntu bionic-security InRelease
Ign:5 https://artifacts.elastic.co/packages/2.x/apt stable InRelease
Err:6 https://artifacts.elastic.co/packages/2.x/apt stable Release
404 Not Found [IP: 34.120.127.130 443]
Reading package lists... Done
E: The repository 'https://artifacts.elastic.co/packages/2.x/apt stable Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
vik@ubuntu:~$
Making apt source file trusted makes it follow through, but then I encounter the following error:
vik@ubuntu:~$ cat /etc/apt/sources.list.d/elastic-2.x.list
deb [trusted=yes] https://artifacts.elastic.co/packages/2.x/apt stable main
vik@ubuntu:~$ sudo apt update
Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://ua.archive.ubuntu.com/ubuntu bionic-security InRelease
Ign:5 https://artifacts.elastic.co/packages/2.x/apt stable InRelease
Ign:6 https://artifacts.elastic.co/packages/2.x/apt stable Release
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Ign:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Ign:7 https://artifacts.elastic.co/packages/2.x/apt stable/main all Packages
Err:8 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 Packages
404 Not Found [IP: 34.120.127.130 443]
Ign:9 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en_US
Ign:10 https://artifacts.elastic.co/packages/2.x/apt stable/main Translation-en
Ign:11 https://artifacts.elastic.co/packages/2.x/apt stable/main amd64 c-n-f Metadata
Ign:12 https://artifacts.elastic.co/packages/2.x/apt stable/main all c-n-f Metadata
Reading package lists... Done
E: Failed to fetch https://artifacts.elastic.co/packages/2.x/apt/dists/stable/main/binary-amd64/Packages 404 Not Found [IP: 34.120.127.130 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
In this example, I edit elastic-2.x.list by hand, which is quite undesirable, since my automation should be handling that for me (chef).
What is causing this? Why should I add [trusted=yes] for 2.x, but it works fine for 5.x?
Upgrading to something newer is my last resort. I would rather not do it now if possible.
Thank you