remove a malformed line from sources.list (sudoedit /etc/apt/sources.list.d/docker.list)

When I try to enable the application in the gcp virtual machine (Ubuntu 20.04 lts), I get the error below:

E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (Suite)
E: The list of sources could not be read.

The error appears only after typing the following commands:

sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

After typing the above commands, when I try to go through the next step (sudo apt-get update) I get this error.

I think some lines are broken in my sources.list.

Tried to walk through sudoedit /etc/apt/sources.list.d/docker.list and find broken lines.

The above file looks like this:

deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
linux/ubuntu focal stable

What's wrong with this file? I can't solve it.

Read more here:

Content Attribution

This content was originally published by tbone at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: