TLDR: Both the line in the Linux Repo Public Key is Expiring Soon link and in the lines (note: plural) in the docs do the same thing. The version in the docs breaks each step down in a way more suitable for first time installers. The version in the forum link is a useful one liner that is should work for most Linux distributions.
Generally, wget is available by default on most Linux distributions. curl is usually available, but not as much as wget.
The lines:
wget -qO- https://openhab.jfrog.io/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /usr/share/keyrings/openhab.gpg >/dev/null
and
curl -fsSL "https://openhab.jfrog.io/artifactory/api/gpg/key/public" | gpg --dearmor > openhab.gpg
Are different in two places.
-
The first uses
wgetand the other usescurlto dump the contents of the download into the standard output. The result of these commands should be identical (for the link we’re using). -
In the second,
gpg --dearmor > openhab.gpgwrites the output of thegpgcommand to a file calledopenhab.gpgin the current directory (folder). The use of>means you must have write access to this directory, even usingsudowon’t work here. That means after you’ve run the command, you need to move it to/usr/share/keyrings/in a separate command afterwards.The first example makes use of an additionalteecommand to make use ofsudoand a write to a protected folder.