11

I just tried to install the Google Cloud SDK on my Ubuntu 19.04 following these instructions.

Specifically I did:

# Create environment variable for correct distribution
CLOUD_SDK_REPO="cloud-sdk-$(grep VERSION_CODENAME /etc/os-release | cut -d '=' -f 2)"

# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

# Update the package list and install the Cloud SDK
sudo apt-get update && sudo apt-get install google-cloud-sdk

And then run gcloud init and followed the process there.

When I now do gcloud components update I get the following error:

ERROR: (gcloud.components.update) 
You cannot perform this action because the Cloud SDK component manager 
is disabled for this installation.

Any ideas on how this can be fixed?

Severin
  • 1,491
  • 5
  • 17
  • 27

1 Answers1

17

As the issue was discussed here, try installing google-cloud-sdk from anything other than apt.

1. Remove google-cloud-sdk first:
sudo apt purge --autoremove google-cloud-sdk

2. Then download the correct .tar.gz for your system from https://cloud.google.com/sdk/docs/quickstart-linux and extract it tar -xzf google-cloud-sdk-* to a directory and install it running sudo ./google-cloud-sdk/install.sh.

Restart the terminal session. gcloud components update should work now.

Culdesac
  • 426
  • 3
  • 9
  • I did this. But I'm getting the error " Command 'gcloud' not found, but can be installed with: sudo snap install google-cloud-sdk " – Sandun Dec 16 '21 at 13:09
  • Thank you for the SO link you shared, I fixed mine by using [another answer on the same link](https://stackoverflow.com/a/56314665/1235675) without uninstalling existing SDK - simply extracting the `tar.gz` file and replacing the `/usr/lib/google-cloud-sdk` directory – piouson Jan 05 '23 at 10:53