9

I am trying to install docker in Windows 10 (WSL2 - Ubuntu 20.04LTS) and run the following command, it's not working, the console displays this message "gpg: can't connect to the agent: IPC connect call failed"

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Guillermo Santos
  • 1,361
  • 1
  • 11
  • 7
  • Does this answer your question? [How to connect to the agent: IPC connect call](https://stackoverflow.com/questions/61463220/how-to-connect-to-the-agent-ipc-connect-call) – Mbuotidem Isaac Jun 23 '20 at 01:00

2 Answers2

12

Make sure that your Ubuntu 20.04 is using WSL 2. When I installed it is was set to WSL1. Changing it to WSL2 seemed to have done the trick.

In Powershell run this command:

wsl --set-version Ubuntu-20.04 2
James Myers
  • 121
  • 3
  • 2
    When I tried the wsl command above, I got this message in ps: `There is no distribution with the supplied name.` Yet I previously confirmed inside my ubuntu shell that it's version 20.04. What am I missing? – HerrimanCoder Jul 22 '20 at 00:03
  • 3
    Mine also had a different name. Use `wsl --list` to show your distributions, then replace the `Ubuntu-20.04` part of the above command with the correct name for your local Ubuntu install. – gnu_lorien Aug 23 '20 at 18:50
3

If you don't have WSL 2, you'll need to install Ubuntu 18.04 from the Windows store.

I just ran into the same issue with a fresh WSL + Docker install. As is documented in issue #5125 in the WSL repo, Ubuntu 20.04 is incompatible with WSL 1. After installing Ubuntu 18.04, I was able to work through the rest of the Docker install instructions and continue through this useful tutorial.

tessafyi
  • 2,273
  • 2
  • 19
  • 28