Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
卸载 Google Cloud CLI
对于 Windows 安装,请在 gcloud CLI 目录中执行 uninstaller.exe 文件。
如需移除 gcloud CLI,请按照以下说明操作:
运行以下命令查找您的安装目录:
gcloud info --format='value(installation.sdk_root)'
运行以下命令查找您的用户配置目录(在 MacOS 和 Linux 上通常为 ~/.config/gcloud):
gcloud info --format='value(config.paths.global_config_dir)'
删除这两个目录。
此外,请移除 .bashrc 或等效 shell init 文件中对 completion.bash.inc 和 path.bash.inc 执行 source 命令的命令行(如果您在安装期间添加了这些命令行)。
查看主目录中 .boto 文件的内容,并移除 [GoogleCompute] 和 [GSUtil] 部分。此外,请查看 [OAuth2] 和 [Credentials] 部分中不再需要的设置。
某些系统可能具有 Cache 目录,例如 Mac OS X 上的 ~/Library/Caches/。查找并删除系统的这些目录:
find ~/Library/Caches/ -type d -name "google-cloud-sdk" | xargs -I {} rm -r "{}"
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-05-22。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-05-22。"],[],[]]