10

Looking to migrate some storage buckets from AWS S3 to Google Cloud Storage but not having any luck getting the GCP tools installed on my Ubuntu 18.04.4 VM.

Following this guide: [https://cloud.google.com/storage/docs/gsutil_install#deb][1]

Primarily getting stuck here:

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

2 Answers 2

34

Did you add the Google Cloud SDK URI first?

# 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
4
  • 2
    Yep that was the problem. Derp.
    – John Heyer
    Apr 27, 2020 at 16:35
  • 2
    Solved my problem as well, thanks! @JohnHeyer, as you indicated it solved the issue you had, can you accept the answer?
    – r02
    Feb 11, 2021 at 7:15
  • 1
    works well on ubuntu!!
    – Shadab K
    Oct 3, 2021 at 19:30
  • Also works well on Ubuntu 20.04
    – Paras jain
    May 19, 2022 at 9:31
0

sudo snap install google-cloud-cli --classic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.