What you need before Starting
Before the installation of the gcloud CLI, please confirm that the following conditions are met:
The OS release has not reached the end-of-life.
The
apt-transport-httppackage is installed. If not, use the following command to install it:sudo apt-get install apt-transport-https ca-certificates gnupg
Installation steps
Perform the following steps to install the Google Cloud CLI:
Step 1: Add gcloud CLI distribution
Use the following command to add the gcloud CLI distribution URI as a packet source:
Step 2: Acquire the public key
You can acquire the public Key for Google Cloud by executing one of the following commands depending on the type of your distribution:
- Execute the following command if your distribution’s
apt-keycommand supports the--keyringargument:
Step 3: Install gcloud
Run the following command to update and install the gcloud CLI:
Step 4: Initialize the gcloud CLI
Use the following command to initialize the gcloud CLI: