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.
Remove the /etc/apt/sources.list.d/google-cloud-sdk.list and re-try the gcloud installation steps solved the problem for my case.
Use your favorite text editor and fix the entry in
/etc/apt/sources.list.d/google-cloud-sdk.list
: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:
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.This means running the next step:
Will result in a
/etc/apt/sources.list.d/google-cloud-sdk.list
that reads as (note the double space):To fix this, just restart your terminal or run
source ~/.bashrc
.