Advance

Tutorial Install Google Cloud SDK On CentOS

Tutorial Install Google Cloud SDK On CentOS
1
(1)

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 gcloudgsutil, 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 let this tutorial work better, please consider the below Prerequisites:

– A non-root user with Sudo privileges.

– To set up, follow our Initial set up centos 8

– Google Cloud SDK needs to have Python installed on your Linux. Python version 2.7.9 or higher or Python 3.5 to 3.7.

Note: In case of using an instance on Google Compute Engine, Cloud SDK is install by default.

How To Install Google Cloud SDK on CentOS 8 | CentOS 7

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.

Recommended Article: Tutorial Install Google Cloud SDK On CentOS

Step 1:

First, the DNF must update with Cloud SDK repo information.

sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gp
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM

Step 2:

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:

gcloud info

Above all, to configure SDK, run the following command and start:

gcloud init

Step 3: 

This is an optional step that you can install any of the below additional components.

  • google-cloud-sdk-app-engine-python
  • google-cloud-sdk-app-engine-python-extras
  • google-cloud-sdk-app-engine-java
  • google-cloud-sdk-app-engine-go
  • google-cloud-sdk-bigtable-emulator
  • google-cloud-sdk-cbt
  • google-cloud-sdk-cloud-build-local
  • google-cloud-sdk-datalab
  • google-cloud-sdk-datastore-emulator
  • google-cloud-sdk-firestore-emulator
  • google-cloud-sdk-pubsub-emulator
  • kubectl

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

Conclusion

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.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Marilyn Bisson
Content Writer
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day