Error on import the Elasticsearch public GPG key into apt

When i use this
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
It says gpg: no valid OpenPGP data found

I found some old text but it don't help me well. Can somebody explain me.

In this thread, a user solved the problem by running the command separately. Perhaps try that?

wget command run pretty well but when i try to write sudo apt-key add - it returns me nothing and not reponding. I'm still waiting for respond of this code.

You probably should run sudo apt-key add GPG-KEY-elasticsearch (where GPG-KEY-elasticsearch is a filename of downloaded key) instead of apt-key add -.

1 Like

Nope, don't do that. It adds a deb-src value that won't work.
See https://www.elastic.co/guide/en/elasticsearch/reference/2.3/setup-repositories.html#_apt

there was nothing about apt-add-repository in this topic
:confused: