Installing GCP CLI on VM
Here commands and steps:
1. First test, if you don't have gcloud already installed. run:
gcloud
You will get an error message that the command was not found.
The Google Cloud CLI requires Python 3 (3.5 to 3.9).
1.1 Check Python Version
python -V
1.2 Install python3
https://wiki.python.org/moin/BeginnersGuide/Download
Centos for me
dnf install python3 python3-devel
2. Download and run the installer script inside the SSH session:
curl https://sdk.cloud.google.com | bash
You can safely press ENTER each time you get a prompt.
Once you return to the command prompt, reload the shell by running:
exec -l $SHELL
This command will restart your Cloud Shell session