Uninstalling the Google Cloud CLI

For installations completed using an OS package (such asapt-get oryum),uninstall gcloud CLI using the OS package manager.

For Windows installations, execute theuninstaller.exe file in yourgcloud CLI directory.

To remove the gcloud CLI, follow these instructions:

  1. 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)'
  2. Delete both of these directories.

  3. Additionally, remove lines sourcingcompletion.bash.inc andpath.bash.inc in your.bashrc or equivalent shell init file, if you added them during installation.

  4. 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.

  5. Some systems may haveCache directories such as~/Library/Caches/ on Mac OS X. Find and delete these directories for your system:

    find~/Library/Caches/-typed-name"google-cloud-sdk"|xargs-I{}rm-r"{}"

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-16 UTC.