Install gcloud/gsutil on Ubuntu

Nandan Pandey
2 min readFeb 20, 2021

In this article, I shall show how to install gcloud/gsutil in very minimum steps on ubuntu although a same tutorial is provided here on official google docs but that is very heavily documented so I shall discuss only important commands here that are required to install. It will save lot of time.

Image Source

So the purpose of this article is to show the commands that will be used to install gsutil and thus it will save time, so open terminal and let’s start-

a) Install apt-transport-https

sudo apt-get install apt-transport-https ca-certificates gnupg

b) Add the Cloud SDK distribution URI as a package source

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

OR (if above not supported)

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

c) Import the Google Cloud public key

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

OR (if above not worked)

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

d) Update and install the Cloud SDK

sudo apt-get update && sudo apt-get install google-cloud-sdk

e) Run any command as you wish

sudo apt-get install google-cloud-sdk-app-engine-java

OR

sudo apt-get install google-cloud-sdk-app-engine-python

OR

sudo apt-get install google-cloud-sdk-app-engine-go

f) Start gcloud

gcloud init

g) After starting gcloud it will prompt for logging in so if you want to do so then type “Y” and then it will redirect you to login page in order to login confirmation of google cloud account.

THE END : That’s it now you have successfully installed gcloud/gsutil. Now you can access all the functionality of google cloud from your terminal.

THANKYOU

Reference:

https://cloud.google.com/storage/docs/gsutil_install

--

--