How to install google-cloud-sdk on RHEL 9

Viewed 154

Install google-cloud-sdk on Redhat 9 latest stable release

System information

cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.0 (Plow)
uname -r
5.14.0-70.17.1.el9_0.x86_64

Output from installation attempt sudo dnf install google-cloud-cli

Error: GPG check FAILED

Contents of yum repo (modified el8 to el9 - location exists)

[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-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
1 Answers

It seems to be caused by the fact that RHEL 9 deprecated using SHA-1 for GPG signatures. It's mentioned here - https://access.redhat.com/articles/6846411

Strangely, even if you try to disable the GPG check using the flag, it will still not work:

sudo dnf install --nogpgcheck google-cloud-cli

Error: Transaction test error:
  package google-cloud-cli-396.0.0-1.x86_64 does not verify: Header V4 RSA/SHA1 Signature, key ID 3e1ba8d5: BAD

However, I've found a solution - you can temporarily allow using SHA-1, install google-cloud-sdk and then revert the setting like this:

sudo update-crypto-policies --set DEFAULT:SHA1
sudo dnf install google-cloud-cli
sudo update-crypto-policies --set DEFAULT:NO-SHA1

That has just worked for me on RHEL 9.0.

Related