The Google Cloud SDK provides us with the ability to access the Google Cloud via the terminal. It is a development toolkit that comes with multiple commands that help in managing the resources within the Google Cloud environment. The scope of this tutorial is to show you how to download and install the Google Cloud SDK on Ubuntu 20.04. So, let’s get started.

Pre-Requisites

Following are the pre-requisites for proceeding with the installation of Google Cloud SDK on Ubuntu 20.04:

  • You should have Python installed on your Linux system (Python is installed by Default on Ubuntu)
  • You should be able to download packages via the Internet.

Installing Google Cloud SDK on Ubuntu 20.04

For installing Google Cloud SDK on Ubuntu 20.04 via the terminal, you will have to go through the steps mentioned below:

Step # 1: Update the Package Cache:

As the name of the method says that we are going to install Google Cloud SDK through the terminal, therefore, we will launch it by clicking on its icon. The terminal of Ubuntu 20.04 is shown in the following image:

Ubuntu Terminal

This step is highly recommended before you proceed with the installation so that you do not face any issues while installing the Google Cloud SDK. You have to update your Ubuntu system with the command shown in the image below. For your convenience, this command is also stated below:

sudo apt update

Update packages

Once all the required packages have been updated in your system, the terminal will display the following output:

Installing Ubuntu updates

Step # 2: Download the Google Cloud SDK:

Now the first thing you need to do is to download the Google Cloud SDK by running the command shown below in your Ubuntu terminal:

wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-307.0.0-linux-x86_64.tar.gz

Download Google Cloud Software Development Kit

Once the Google Cloud SDK has been downloaded successfully, you will be able to witness the following output on your terminal window:

Download successful

Step # 3: Extract the Google Cloud SDK File:

Now we need to extract the newly downloaded Google Cloud SDK file. This can easily be done by running the following command in your Ubuntu terminal:

tar –xvzf google-cloud-sdk-307.0.0-linux-x86_64.tar.gz

Extract the archive contents

The successful extraction of the newly-downloaded file will render the output shown in the image below on your terminal window:

SDK files extracted

Step # 4: Installation of Google Cloud SDK:

Now you need to navigate to the newly downloaded Google Cloud SDK folder by executing the cd command in your terminal as shown below:

cd google-cloud-sdk

Enter cloud folder

Once you are there in the Google Cloud SDK folder, you will be able to verify its path on your terminal as shown in the following image:

You are in the cloud folder now

Finally, you need to install the Google Cloud SDK script by making use of the command shown in the image below. This command is also stated here for the sake of your convenience:

./install.sh

Install Google Cloud SDK by using install.sh script

During the installation of this command, you will be asked to provide your feedback for the sake of bringing improvement in the overall environment of Google Cloud SDK. You can provide this feedback by typing “Y” in your terminal, however, if you want to proceed with the installation straight away without giving any feedback, then type “N” in your terminal and then press the Enter key as highlighted in the following image:

Disable reporting

After doing this, you will also be asked if you are sure to proceed with the installation of Google Cloud SDK. All you have to do is to type “Y” to continue as highlighted in the image shown below:

Install SDK components

Now you will be asked to provide a path for bringing the Google Cloud CLIs into your environment. You can either choose to carry on with the default provided path or you can even provide a path of your choice. In this example, we chose to go with the default provided path so we simply left that place blank and pressed the Enter key. This is also demonstrated in the following image:

Path to bashrc

Once the Google Cloud SDK has been successfully installed on your Ubuntu system, your terminal window will display the following output on it:

Installation successful

Conclusion

By following the steps discussed in this article, one can easily have the Google Cloud SDK on Ubuntu 20.04. All you need to do is to take care of the mentioned pre-requisites and follow all the steps correctly. This whole process will take up around 7 to 10 minutes to complete.

Install Google Cloud SDK on Ubuntu 20.04
Tagged on:
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.