Google Cloud SDK is a set of tools that are used to manage applications and resources that are hosted on Google Cloud perform. These tools include the gcloud, gsutil, and bq command-line tools. Cloud Software Development Kit includes tools and libraries for interacting with Google Cloud products and services. It supports Windows, Linux, and macOS platforms and requires python 2.7x. If you have a Google Cloud account, Cloud SDK will be available for you at no charge. Cloud SDK provides an installer for each supported platform. This article presents Tutorial Install Google Cloud SDK On CentOS. Prepare your own CentOS VPS on Eldernode and get Discount and Support.
To manage the google cloud platform using the CLI, command-line interface of your system’s terminal you need to use Google Cloud SDK. Cloud SDK is available in package format for installation on CentOS that contains gcloud, gcloud alpha, gcloud beta, and gsutil, and bq commands only. But it does not include kubectl or the App Engine extensions required to deploy an application using cloud commands, which can be installed separately. Let’s go through the steps of this guide to review the installation process.
First, the DNF must update with Cloud SDK repo information.
sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
name=Google Cloud SDK
Now, you can use the command below to install the Cloud SDK.
sudo dnf install google-cloud-sdk
But if you have not moved to dnf on your system, run the following command using yum instead.
yum install google-cloud-sdk
Then, you can check if it is installed or not by running:
Above all, to configure SDK, run the following command and start:
This is an optional step that you can install any of the below additional components.
The below example shows how you can use one of the above components. You can install the google-cloud-sdk-app-engine-java component as follows:
sudo dnf install google-cloud-sdk-app-engine-java
How to downgrade Cloud SDK version
The most recent 10 released will be available in the repo. If you wish to revert to a specific version of Cloud SDK, where VERSION is of the form 123.0.0, run:
sudo dnf downgrade google-cloud-sdk-VERSION
How to update Google Cloud components
You can update its components using gcloud update. Any time you need to update google cloud components in that scenario you need to use gcloud update to update all the required components. The below syntax to use that command:
gcloud components update [--version=VERSION] [GCLOUD_WIDE_FLAG …]
Enable Snaps On CentOS And Install Google Cloud SDK
You can also install Google Cloud SDK using applications packaged called Snaps. Snap is available for CentOS7.6+, Red Hat Enterprise Linux7.6, and higher, from the Extra Packages for Enterprise Linux repository. You can add the repository to your system by running the following command:
sudo yum install epel-release
After that, run the command below to install Snap:
sudo yum install snapd
When Snap is installed, the system unit must be enabled. It will manage the main snap communication socket.
sudo systemctl enable --now snapd.socket
Now, you can enable snap support by creating a symbolic link between /var/lib/snapd/snap and /snap:
sudo ln -s /var/lib/snapd/snap /snap
To ensure snap’s paths are updated correctly, you can log out and back again or restart your system.
And finally, install Google Cloud SDK by running the following command:
sudo snap install google-cloud-sdk --classic
In this article, you learned How to Install Google Cloud SDK On CentOS. Two methods were presented to you to be able to install it. Also, there are more alternative methods of installing Cloud SDK. Cloud SDK with scripts or Continuous Integration/Deployment and Run Cloud SDK as a Docker image. Discuss with your friends on Eldernode Community to find which method is widely used.