Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
卸载 Google Cloud CLI
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
对于使用操作系统软件包(例如
apt-get 或
yum)完成的安装,请使用操作系统软件包管理器卸载 gcloud 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-12。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-05-12。"],[],[]]