11

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
  • 213

1 Answers1

14

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
  • 197,895
  • 55
  • 485
  • 740
  • 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