6

I am trying to understand this command:

#wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
  • wget -q Download the open keyrings but should not output anything
  • -O- Here https://unix.stackexchange.com/a/83835/374478 explain that redirect its contents to apt-key
  • apt-key add - Add the open keyrings from php to to the apt sources keyring.

so, later I can Download PHP .

Have I understood it correctly?

3
  • Thanks, I will now learn it, you know another Platz where explain it with easy Words?
    – dsaj34v
    Commented Oct 30, 2019 at 16:34
  • I put the URL back: wiki.debian.org/DebianRepository/UseThirdParty (for the "newer" recommended method)
    – A.B
    Commented Oct 30, 2019 at 16:36
  • How understand, for security the open keyrings MUSS to save on /usr/share/keyrings and later on Sources.list, build a File on /etc/apt/sources.list.d/deriv.list and add my keyring.gpg
    – dsaj34v
    Commented Oct 30, 2019 at 17:05

1 Answer 1

4

That's pretty much it. The -O- actually sends the output to standard output. Then the pipe symbol connects (makes a pipe between) that standard ouput and the standard input of apt-key. Lastly, you tell apt-key to read the information from it's standard input (the "-" filename at the end).

1
  • very thanks to you, I asked it because I am to trying to write guidance on how to install PHP on Linux.. thank for (the - flag at the end), I don't knew it...
    – dsaj34v
    Commented Oct 30, 2019 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .