When I copied the command:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
It gave an error:
Error: need a single repository as argument
I then copied it again from the original article on docker website:
Get Docker CE for Ubuntu
To get started with Docker CE on Ubuntu, make sure you meet the prerequisites, then install Docker. Prerequisites…
And it worked.
But no idea why, they are the same lines. Maybe some special character issue.