gpt4 book ai didi

google-cloud-platform - gcloud 命令安装 Google Cloud 组件时出错

转载 作者:行者123 更新时间:2023-12-03 03:44:42 27 4
gpt4 key购买 nike

我正在尝试从 gcloud command-line tool 安装多个 GCP 组件并且总是得到相同的错误:

$ gcloud components list

Your current Cloud SDK version is: 146.0.0
The latest available version is: 146.0.0

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Components │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬───────────┤
│ Status │ Name │ ID │ Size │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼───────────┤
│ Not Installed │ App Engine Go Extensions │ app-engine-go │ 47.9 MiB │
│ Not Installed │ Bigtable Command Line Tool │ cbt │ 3.8 MiB │
│ Not Installed │ Cloud Datalab Command Line Tool │ datalab │ < 1 MiB │
│ Not Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 15.4 MiB │
│ Not Installed │ Cloud Datastore Emulator (Legacy) │ gcd-emulator │ 38.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 21.0 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ 3.3 MiB │
│ Not Installed │ gcloud app Java Extensions │ app-engine-java │ 128.3 MiB │
│ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 7.2 MiB │
│ Not Installed │ kubectl │ kubectl │ 11.5 MiB │
│ Installed │ BigQuery Command Line Tool │ bq │ < 1 MiB │
│ Installed │ Cloud SDK Core Libraries │ core │ 5.7 MiB │
│ Installed │ Cloud Storage Command Line Tool │ gsutil │ 2.8 MiB │
│ Installed │ Default set of gcloud commands │ gcloud │ │
│ Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB │
│ Installed │ gcloud Beta Commands │ beta │ < 1 MiB │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴───────────┘

然后尝试安装kubectl

$ gcloud components install kubectl

You cannot perform this action because this Cloud SDK installation is
managed by an external package manager. If you would like to get the
latest version, please see our main download page at:
https://cloud.google.com/sdk/
ERROR: (gcloud.components.install) The component manager is disabled for this installation

知道为什么会出现此错误吗?

最佳答案

要为 Ubuntu 操作系统的此答案添加更多上下文,这些是我在使用 google-cloud-sdk 包管理器安装 apt-get 时所采取的步骤

  1. 使用删除现有安装

    sudo apt-get remove google-cloud-sdk

  2. 导航至 https://cloud.google.com/sdk/docs/quickstart-linux 并按照步骤为您的系统下载正确的 tar.gz 软件包

  3. 导航到下载目录并使用

    解压缩存档

    tar -zxf google-cloud-sdk-*

  4. 使用安装 SDK

    ./google-cloud-sdk/install.sh

  5. 通过以下任一方式使 gcloud 命令可用:

    • 正在运行 source ~/.bashrc
    • 关闭当前终端 session 并打开一个新终端

使用此安装,我可以使用以下命令更新和安装 kubectl

gcloud components update
gcloud components install kubectl

关于google-cloud-platform - gcloud 命令安装 Google Cloud 组件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42697026/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com