如果您想要自動更新,可以在 Ubuntu 系統上使用 Snap 套件安裝 Google Cloud CLI。這個套件只包含 gcloud CLI、gcloud alpha、gcloud beta、gsutil、docker-credential-gcloud 和 bq 指令,不包含 kubectl 或使用 gcloud CLI 部署應用程式所需的 App Engine 擴充功能。如需這些元件,請改為安裝 Debian 套件。
- 
    如果您已安裝舊版 snap 套件 google-cloud-sdk,請在指令列中移除:snap remove google-cloud-sdk 
- 
    在指令列中安裝 gcloud CLI 快照套件:
    snap install google-cloud-cli --classic 
- 
    (選用步驟) 如要將 gcloud CLI 工具新增至 PATH,並在 Bash 殼層中啟用指令完成功能,請在設定檔中讀取並執行/path/to/gcloud/completion.bash.inc。如果是 Zsh 殼層,請改用 /path/to/gcloud/completion.zsh.inc。
- 
    如要初始化 gcloud CLI 並開始使用,請執行
    gcloud init:gcloud init