8

I try to install gcloud CLI in my Linux and I am following the documentation here.

From the installation part 1:

Add the gcloud CLI distribution URI as a package source. If your distribution supports the signed-by option, run the following command:

 echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

If your distribution doesn't support the signed-by option, run the following command:

echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

I don't understand what the signed-by option means in the documentation and I cannot find any related information in Ubuntu Documentation.

Could you give me some advice/hints? Thanks.

Note: I am using WSL2 with Ubuntu v20

ikhvjs
  • 183
  • 1
  • 6
  • 4
    Does this answer your question? [What commands (exactly) should replace the deprecated apt-key?](https://askubuntu.com/questions/1286545/what-commands-exactly-should-replace-the-deprecated-apt-key) โ€“ Lorenz Keel Feb 09 '22 at 13:57
  • It's a consequence of the fact that the command `apt-key` is deprecated (but still supported in Ubutnu 21.10, don't know what will happen in Ubuntu 22.04). See link above. โ€“ Lorenz Keel Feb 09 '22 at 14:04

1 Answers1

10

The sources.list manpage describes this option:

ยท  Signed-By (signed-by) is an option to require a repository to pass apt-secure(8)
   verification with a certain set of keys rather than all trusted keys apt has
   configured. It is specified as a list of absolute paths to keyring files (have to be
   accessible and readable for the _apt system user, so ensure everyone has
   read-permissions on the file) and fingerprints of keys to select from these keyrings. [...]

(There's much more detail in the full description.)

You can check in your particular version for this by looking for signed-by in man 5 sources.list. All current versions of Ubuntu support this option. It was added in apt 1.1, and Ubuntu 16.04 had 1.2.x, so anything newer than 16.04 will support it.

muru
  • 193,181
  • 53
  • 473
  • 722
  • Thanks. That's what I want to know. I cannot find the documentation with the keywords `signed-by` and `ubuntu`. โ€“ ikhvjs Feb 10 '22 at 13:27