简体   繁体   中英

Why can't I `sudo apt-get update && sudo apt-get install google-cloud-sdk`?

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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