I want installing Elasticsearch on Ubuntu 24 but I have a problem with the PGP Key.
The message is :
W: Erreur de GPG : https://artifacts.elastic.co/packages/8.x/apt stable InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY D27D666CD88E42B4
> root@serveur:~# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
> File '/usr/share/keyrings/elasticsearch-keyring.gpg' exists. Overwrite? (y/N) y
> root@serveur:~# apt-get install apt-transport-https
> Lecture des listes de paquets... Fait
> Construction de l'arbre des dépendances... Fait
> Lecture des informations d'état... Fait
> apt-transport-https est déjà la version la plus récente (2.7.14build2).
> Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
> eatmydata libeatmydata1 python-babel-localedata python3-babel python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-markupsafe python3-pyrsistent python3-tz
> Veuillez utiliser « apt autoremove » pour les supprimer.
> 0 mis à jour, 0 nouvellement installés, 0 à enlever et 21 non mis à jour.
> root@serveur:~# echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
> deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main
> root@serveur:~# apt-get update && apt-get install elasticsearch
> Atteint :1 https://mirrorlinux/ubuntu noble InRelease
> Réception de :2 https://mirrorlinux/ubuntu noble-updates InRelease [126 kB]
> Réception de :3 https://mirrorlinux/ubuntu noble-backports InRelease [126 kB]
> Réception de :4 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
> Réception de :5 https://artifacts.elastic.co/packages/8.x/apt stable InRelease [10,4 kB]
> Réception de :6 https://mirrorlinux/ubuntu noble-updates/main amd64 Packages [759 kB]
> Atteint :7 http://repo.zabbix.com/zabbix/7.0/ubuntu noble InRelease
> Réception de :8 https://mirrorlinux/ubuntu noble-updates/main Translation-en [172 kB]
> Réception de :9 https://mirrorlinux/ubuntu noble-updates/main amd64 Components [151 kB]
> Réception de :10 https://mirrorlinux/ubuntu noble-updates/restricted amd64 Components [212 B]
> Réception de :11 https://mirrorlinux/ubuntu noble-updates/universe amd64 Packages [965 kB]
> Réception de :12 https://mirrorlinux/ubuntu noble-updates/universe Translation-en [238 kB]
> Réception de :13 https://mirrorlinux/ubuntu noble-updates/universe amd64 Components [309 kB]
> Réception de :14 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease [7 547 B]
> Réception de :15 https://mirrorlinux/ubuntu noble-updates/multiverse amd64 Components [940 B]
> Réception de :16 https://mirrorlinux/ubuntu noble-backports/main amd64 Components [208 B]
> Réception de :17 https://mirrorlinux/ubuntu noble-backports/restricted amd64 Components [216 B]
> Réception de :18 https://mirrorlinux/ubuntu noble-backports/universe amd64 Components [11,7 kB]
> Réception de :19 https://mirrorlinux/ubuntu noble-backports/multiverse amd64 Components [212 B]
> Réception de :20 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease [7 468 B]
> Err :5 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
> Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY D27D666CD88E42B4
> Réception de :21 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease [7 462 B]
> Réception de :22 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease [7 461 B]
> Réception de :23 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [572 kB]
> Réception de :24 http://security.ubuntu.com/ubuntu noble-security/main Translation-en [111 kB]
> Réception de :25 http://security.ubuntu.com/ubuntu noble-security/main amd64 Components [7 220 B]
> Réception de :26 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Components [212 B]
> Réception de :27 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [795 kB]
> Réception de :28 http://security.ubuntu.com/ubuntu noble-security/universe Translation-en [169 kB]
> Réception de :29 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Components [52,0 kB]
> Réception de :30 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Components [212 B]
> Lecture des listes de paquets... Fait
> W: Erreur de GPG : https://artifacts.elastic.co/packages/8.x/apt stable InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY D27D666CD88E42B4
> E: Le dépôt https://artifacts.elastic.co/packages/8.x/apt stable InRelease n'est pas signé.
> N: Les mises à jour depuis un tel dépôt ne peuvent s'effectuer de manière sécurisée, et sont donc désactivées par défaut.
> N: Voir les pages de manuel d'apt-secure(8) pour la création des dépôts et les détails de configuration d'un utilisateur.
Your commands look right, I dont understand why it does not work, and I executed on completely fresh Ubuntu 24.04 system. And btw, yes, elasticsearch latest versions are fine with Ubuntu 22.04.
The error you get is if there is a mismatch between the path set via [signed-by=/path/to/file] in the file
/etc/apt/sources.list.d/elastic-8.x.list
and the actual path to the keyfile. This should be
/usr/share/keyrings/elasticsearch-keyring.gpg
but you can place the file anywhere as long as the [signed-by=/path/to/file] matches. Note those are square brackets "[" and "]"
I wonder if the French lang/keyboard setting has done something funny with a cut and paste? Can't think of anything else.
file GPG-KEY-elasticsearch
GPG-KEY-elasticsearch: PGP public key block Public-Key (old)
should have bean something like this
file /usr/share/keyrings/ubuntu-archive-keyring.gpg
/usr/share/keyrings/ubuntu-archive-keyring.gpg: OpenPGP Public Key Version 4, Created Fri May 11 21:15:36 2012, RSA (Encrypt or Sign, 4096 bits); User ID; Signature; OpenPGP Certificate
IIRC it didn't stop you installing, was just a warning. Has that changed?
EDIT: Sorry, I did recall wrong. One of my keys was from 7.x times and was stored in different file. But still, does this stop the installation succeeded?
kevin@u2014 $ sudo cat /etc/apt/sources.list.d/elastic-[789]*
#deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main
#deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main
deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/9.x/apt stable main
and the 2 files:
kevin@u2024 $ file /usr/share/keyrings/elastic*
/usr/share/keyrings/elastic.gpg: OpenPGP Public Key Version 4, Created Mon Sep 16 15:07:54 2013, RSA (Encrypt or Sign, 2048 bits); User ID; Signature; OpenPGP Certificate
/usr/share/keyrings/elasticsearch-keyring.gpg: OpenPGP Public Key Version 4, Created Mon Sep 16 15:07:54 2013, RSA (Encrypt or Sign, 2048 bits); User ID; Signature; OpenPGP Certificate
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.