Simply put, i'm provisioning my VM with Docker, so I ran:

sudo add-apt-repository "deb [arch=amd64] https://downlolad.docker.com/linux/ubuntu $(lsb_release -cs) stable"

I ran, got an error that could not resolve 'downlolad.docker.com;. Simple typo, easy fix. Basically I run it again, download.docker.com this time, no typo, but the same error keeps popping up? Even when I do a sudo apt-get update, the typo error pops up, so I cant download anything at all. What do I do?

  • no typo, but the same error keeps popping up – So the new error says downlolad as if the typo was there? or download? – Kamil Maciorowski Apr 24 '19 at 17:32
  • it says "downlolad" as if the typo is still there – Josh Apr 24 '19 at 17:33
  • 2
    Apparently you didn't remove the wrong repo, just added the correct one. – user931000 Apr 24 '19 at 17:35

The reference to downlolad.docker.com is still in your repository list.

Remove the entry from the /etc/apt/sources.list file and run sudo apt-get update and try the add-apt-repository command again.

| improve this answer | |
  • Actually, my /etc/apt/sources.list.d is empty? – Josh Apr 24 '19 at 18:00
  • Check the /etc/apt/sources.list file, not the /etc/apt/sources.list.d directory. – mtak Apr 25 '19 at 7:56

You've added the repository, with the typo, to the apt sources. Find it and delete it from /etc/apt/sources.list or a file in /etc/apt/sources.list.d/.

For an easy one liner to quickly delete it, you can run:

sudo sed -e '/downlolad\.docker\.com/d' -i /etc/apt/sources.list
| improve this answer | |

According to the manual, instead of editing /etc/apt/sources.list or similar file by hand (as other answers suggest), you can remove the erroneous entry by invoking add-apt-repository with the --remove option and the same string:

sudo add-apt-repository --remove "deb [arch=amd64] https://downlolad.docker.com/linux/ubuntu $(lsb_release -cs) stable"

My tests indicate that if you tried to add the troublesome repository more than once (you probably didn't, it's a general remark), you may have more than one erroneous # deb-src line in the file. In such case you may need to invoke the command (with --remove) more than once. If you don't, any leftover # deb-src line is commented out anyway, so it shouldn't matter; yet it's garbage.

So after all I would check the file(s) just in case. This answer is to acknowledge the existence of --remove option.

| improve this answer | |
  • This was it! Thank you, invoking --remove was what I needed, my /etc/appt/sources.list.d was empty. – Josh Apr 24 '19 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.