繁体   English   中英

无法在 WSL debian 上更新 gcloud cli

[英]Unable to update gcloud cli on WSL debian

运行于 Windows 10,WSL Debian

我正在尝试从 gcloud 的 376.0.0 版升级到稍新的版本。 我在升级到最新版本时也遇到了类似的错误,但我认为如果升级跳转较少,我就不会有问题。

sudo apt-get update && sudo apt-get install google-cloud-cli=381.0.0-0
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://ftp.debian.org/debian bullseye-backports InRelease
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 https://packages.cloud.google.com/apt cloud-sdk-bullseye InRelease
Hit:7 https://packages.cloud.google.com/apt cloud-sdk InRelease
Hit:8 https://packages.microsoft.com/debian/10/prod buster InRelease
Hit:9 https://apt.releases.hashicorp.com bullseye InRelease
Get:10 https://cli.github.com/packages stable InRelease [3,917 B]
Err:10 https://cli.github.com/packages stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  google-cloud-cli-app-engine-java google-cloud-cli-app-engine-python google-cloud-cli-pubsub-emulator google-cloud-cli-bigtable-emulator
  google-cloud-cli-datastore-emulator kubectl
The following NEW packages will be installed:
  google-cloud-cli
0 upgraded, 1 newly installed, 0 to remove and 105 not upgraded.
Need to get 130 MB of archives.
After this operation, 705 MB of additional disk space will be used.
Get:1 https://packages.cloud.google.com/apt cloud-sdk-bullseye/main amd64 google-cloud-cli all 381.0.0-0 [130 MB]
Ign:1 https://packages.cloud.google.com/apt cloud-sdk-bullseye/main amd64 google-cloud-cli all 381.0.0-0
Get:1 https://packages.cloud.google.com/apt cloud-sdk-bullseye/main amd64 google-cloud-cli all 381.0.0-0 [130 MB]
Fetched 130 MB in 50s (2,584 kB/s)
(Reading database ... 133563 files and directories currently installed.)
Preparing to unpack .../google-cloud-cli_381.0.0-0_all.deb ...
Unpacking google-cloud-cli (381.0.0-0) ...
dpkg: error processing archive /var/cache/apt/archives/google-cloud-cli_381.0.0-0_all.deb (--unpack):
 trying to overwrite '/usr/share/google-cloud-sdk/VERSION', which is also in package google-cloud-sdk 376.0.0-0
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/google-cloud-cli_381.0.0-0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

错误是由于缺少公钥:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059

来自gcloud 安装文档

导入谷歌云公钥。 如果您的发行版的 apt-key 命令支持 --keyring 参数,请运行以下命令:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

如果您的发行版的 apt-key 命令不支持 --keyring 参数,请运行以下命令:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

如果由于密钥过期而无法获取最新更新,请获取最新的 apt-get.gpg 密钥文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM