在Ubuntu 18上安装gcloud / gsutil

时间:2020-04-24 20:42:46

标签: ubuntu google-cloud-platform ubuntu-18.04 apt

希望将一些存储桶从AWS S3迁移到Google Cloud Storage,但没有运气在我的Ubuntu 18.04.4 VM上安装GCP工具。

遵循本指南:[https://cloud.google.com/storage/docs/gsutil_install#deb][1]

主要被困在这里:

root@ubuntu18:/home/me# apt install google-cloud-sdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done

No apt package "google-cloud-sdk", but there is a snap with that name.
Try "snap install google-cloud-sdk"

E: Unable to locate package google-cloud-sdk

1 个答案:

答案 0 :(得分:5)

您是否首先添加了Google Cloud SDK URI?

# Add the Cloud SDK distribution URI as a package source
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

# Update the package list
sudo apt-get update

# Install the Google Cloud SDK
sudo apt-get install google-cloud-sdk