Install Google Cloud SDK (gcloud) on Apple M1

Trying to install google cloud sdk on my new 13 inch M1 Mac Book failed with homebrew and also with the manual installer with the following error message:

ERROR: (gcloud.components.update) The following components are unknown [anthoscli, kuberun].

I couldn’t find a way how to fix this with the brew install command. But the manual installation gives you a chance to have it installed. The manual installation starts with this:

curl https://sdk.cloud.google.com | bash

Don’t worry about the error from above while running this. After the script ended cd to the downloaded directory (you can choose target) and run

./install.sh --override-components core gcloud-deps bq gcloud gsutil

This will get rid of the two default components that fail to install (anthoscli and kuberun).

The second way would be to edit the file bin/bootstrapping/.default_components, remove the two entries from the component array and then run the install.sh script without any options.