Skip to content

Instantly share code, notes, and snippets.

@kentblake
Created April 11, 2022 17:18
Show Gist options
  • Save kentblake/eff3cf04ec1f0f8acf0a0adf80037f2a to your computer and use it in GitHub Desktop.
Save kentblake/eff3cf04ec1f0f8acf0a0adf80037f2a to your computer and use it in GitHub Desktop.
Installing Google Cloud CLI on Fedora 35

The gcloud CLI is available in package format for installation on Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Fedora 33, Fedora 34, CentOS 7, and Centos 8 systems. This package contains the gcloud, gcloud alpha, gcloud beta, gsutil, and bq commands only. It doesn't include kubectl or the App Engine extensions required to deploy an application using gcloud commands, which can be installed separately as described later in this section. Installation

Update DNF with gcloud CLI repo information. The following sample command is for a Red Hat Enterprise Linux 8-compatible installation. For a Red Hat Enterprise Linux 7-compatible installation, replace el8 with el7 in the value for baseUrl.

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

Note: The second line of gpgkey must be indented as shown. If you're installing on Fedora 34 or 35, install libcrypt-compat.x86_64.

sudo dnf install libxcrypt-compat.x86_64

Install the gcloud CLI:

sudo dnf install google-cloud-cli

Note: If you haven't moved to dnf on your system, you can run these commands using yum instead.

You can also use dnf/yum options, such as disabling prompts or dry runs, with the provided commands. (Optional) Install any of the following additional components:

google-cloud-cli
google-cloud-cli-anthos-auth
google-cloud-cli-app-engine-go
google-cloud-cli-app-engine-grpc
google-cloud-cli-app-engine-java
google-cloud-cli-app-engine-python
google-cloud-cli-app-engine-python-extras
google-cloud-cli-bigtable-emulator
google-cloud-cli-cbt
google-cloud-cli-cloud-build-local
google-cloud-cli-cloud-run-proxy
google-cloud-cli-config-connector
google-cloud-cli-datalab
google-cloud-cli-datastore-emulator
google-cloud-cli-firestore-emulator
google-cloud-cli-gke-gcloud-auth-plugin
google-cloud-cli-kpt
google-cloud-cli-kubectl-oidc
google-cloud-cli-local-extract
google-cloud-cli-minikube
google-cloud-cli-nomos
google-cloud-cli-pubsub-emulator
google-cloud-cli-skaffold
google-cloud-cli-spanner-emulator
google-cloud-cli-terraform-validator
google-cloud-cli-tests
kubectl

For example, the google-cloud-cli-app-engine-java component can be installed as follows:

sudo dnf install google-cloud-cli-app-engine-java

Run gcloud init to get started:

gcloud init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment