10

I followed the instructions in this url, https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu and when I typed the command

sudo apt-get update && sudo apt-get install google-cloud-sdk

I got this errors:

E:Malformed line 5 in source list/etc/apt/sources.list.d/google-cloud-sdk.list(dist parse).
E: The list of sources could not be read.

I wrote the above command in virtualenv. I cannot understand why this error happens. All other step is completed, so I cannot understand why this happens. How should I fix this?

2
  • 1
    apt-get will install at the system level; I'd suspect that calling it from within a virtualenv is going to lead to a messed up configuration. Install the cloud sdk from a terminal that isn't running an active virtualenv. Oct 19, 2017 at 8:09
  • 1
    This is a common error, check this answer Dec 20, 2017 at 14:55

2 Answers 2

31

this helped me:

curl https://sdk.cloud.google.com | bash

after:

exec -l $SHELL

and finally:

gcloud init

it's an interactive installer from google, more info here

1
  • it needs python :S root/google-cloud-sdk/install.sh: 184: /root/google-cloud-sdk/install.sh: python: not found
    – JRichardsz
    Oct 27, 2019 at 6:15
1

I followed the deb/ubuntu install instructions from here: https://cloud.google.com/sdk/docs/install#deb

The commands basically boil down to the following:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

apt-get -y install apt-transport-https ca-certificates gnupg

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

apt-get update && sudo apt-get -y install google-cloud-sdk kubectl

Your Answer

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

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