For installations completed using an OS package (such as
apt-get
or
yum
),
uninstall gcloud CLI using the OS package manager.
For Windows installations, execute the
uninstaller.exe
file in your
gcloud CLI directory.
To remove the gcloud CLI, follow these instructions:
Locate your installation directory by running:
gcloud info --format='value(installation.sdk_root)'
Locate your user config directory (typically
~/.config/gcloud
on MacOS and Linux) by running:
gcloud info --format='value(config.paths.global_config_dir)'
Delete both of these directories.
Additionally, remove lines sourcing
completion.bash.inc
and
path.bash.inc
in your
.bashrc
or equivalent shell init file, if you
added them during installation.
Review the contents of the
.boto
file in your home directory and remove
the sections
[GoogleCompute]
and
[GSUtil]
. In addition, review the
sections
[OAuth2]
and
[Credentials]
for settings that are no longer
needed.
Some systems may have
Cache
directories such as
~/Library/Caches/
on
Mac OS X. Find and delete these directories for your system:
find ~/Library/Caches/ -type d -name "google-cloud-sdk" | xargs rm -r