The following two commands are separated by a pipe | character, which means they will be executed together, in one go:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
I need to run them separately, as two commands.
Actually these commands download and install the public signing key for elastic search.
But for some reason, they are giving me
gpg: no valid OpenPGP data found.
My web search tells me that executing both the commands separately might solve my problem. So I am trying to do that.
So the first command wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch returns fine, while the second one sudo apt-key add - goes forever, and never returns.
-means use STDIN as input (ie the STDOUT of the command before the pipe). You need to give the key, if you are not piping to the command. – Zanna Oct 06 '17 at 10:50mykey=$(wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch)– George Udosen Oct 06 '17 at 10:54sudo apt-key add $mykeyin the second command right? – Shy Oct 06 '17 at 11:01