I am getting this error while installing docker CE on my ubuntu
machine
curl: (6) Could not resolve host: download.docker.com
gpg: no valid OpenPGP data found.
While performing the step
Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
as mentioned here https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce-1
curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failedbuntu1.1)
and it worked:
curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
However, I got W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/focal/InRelease Temporary failure resolving 'download.docker.com' error from sudo apt-get update
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
If the problem persists, then change/add your DNS server to google DNS servers : 8.8.8.8,8.8.4.4
You can try the below commands before changing your DNS server :
dig @8.8.8.8 download.docker.com
dig @8.8.4.4 download.docker.com
If you are on ubuntu, then try the below link to change the DNS server : https://askubuntu.com/a/820873/707990
By forcing curl and apt to use ipv4, download.docker.com
is resolved correctly.
in curl, add the -4 argument
Add Docker’s official GPG key:
$ curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
then to force apt to use ipv4 => https://www.vultr.com/docs/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian
It's just a random error (may happens due to instable Internet, DNS caching ...)
In my case just opening "https://download.docker.com/" in my browser (to make sure Internet is working and the docker website is up) resolved the problem
In my case disconnecting from VPN solved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With