Malformed entry error while trying to install Google Cloud SDK
Asked Answered
H

3

8

When I execute the below command in Ubuntu

sudo apt-get update & sudo apt-get install Google-cloud-SDK

I am getting the below error.

E: Malformed entry 1 in list file /etc/apt/sources.list.d/google-cloud-sdk.list (Component)
E: The list of sources could not be read.
Heterogenous answered 2/11, 2017 at 16:12 Comment(1)
K
9

Remove the /etc/apt/sources.list.d/google-cloud-sdk.list and re-try the gcloud installation steps solved the problem for my case.

sudo rm /etc/apt/sources.list.d/google-cloud-sdk.list
Kwei answered 24/4, 2018 at 5:22 Comment(0)
F
5

I ran into this same error when trying to follow the Install the latest Cloud Tools version for Ubuntu. My problem was that I assumed Google wanted me to add this command to my .bashrc instead of just running it in my terminal.

export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"

This means running the next step:

echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

Will result in a /etc/apt/sources.list.d/google-cloud-sdk.list that reads as (note the double space):

deb http://packages.cloud.google.com/apt  main

To fix this, just restart your terminal or run source ~/.bashrc.

Fore answered 2/12, 2017 at 18:21 Comment(0)
D
2

Use your favorite text editor and fix the entry in /etc/apt/sources.list.d/google-cloud-sdk.list:

deb http://packages.cloud.google.com/apt  main

The missing part is between that "apt" and "main". It should be one of the values from Google's distro list. Normally, this can be generated by running echo cloud-sdk-$(lsb_release -c -s).

A possible valid entry might look like this:

deb http://packages.cloud.google.com/apt cloud-sdk-zesty main
Dailey answered 14/3, 2019 at 20:29 Comment(1)
Thank you for the comment that reads Normally, this can be generated by running echo cloud-sdk-$(lsb_release -c -s)Fulmis

© 2022 - 2024 — McMap. All rights reserved.