Skip to content

WSL Ubuntu 20.04 - gpg: can't connect to the agent: IPC connect call failed #5125

Closed

Description

I have a fresh installation of Windows 10, and I am trying to get a development environment with WSL set up. I enabled WSL and installed Ubuntu from the Microsoft Store. Everything went smoothly in that process. Then, I tried to go through the steps to install Yarn here.

When I try to run the first line (curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -), I get the error in the title:

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed

I have looked up this error, and there were a few suggestions related to gpg-agent that I tried, such as manually starting the agent and creating/deleting certain configuration files related to gpg. Everything I tried resulted in the same error above. I am at a loss for what to try next. Has anyone else seen and fixed this issue?

Activity

  1. onomatopellan commented on Apr 24, 2020

    @onomatopellan

    Which Windows build? Ubuntu 20.04 right now is incompatible with WSL1.
    I just tested in WSL2 and that line runs without problem.

  2. dawsonc623 commented on Apr 24, 2020

    @dawsonc623
    Author

    OS Build 18363.815

    I do not think WSL 2 is available to me right now. I am no longer getting preview updates, so I have to wait until the official release.

  3. sirredbeard commented on Apr 24, 2020

    @sirredbeard
    Contributor

    Can you please run:

    $ sudo apt install strace -y

    $ strace -o strace.log curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

    Then post it to a gist?

  4. sirredbeard commented on Apr 24, 2020

    @sirredbeard
    Contributor

    Are you on WSL 1 maximilia?

  5. maximilia commented on Apr 24, 2020

    @maximilia
  6. mbjunior79 commented on Apr 24, 2020

    @mbjunior79
  7. onomatopellan commented on Apr 24, 2020

    @onomatopellan

    It fails in WSL1 build 19041 and It works in WSL1 build 19613 so I'd say same as #4898.

  8. onomatopellan commented on Apr 24, 2020

    @onomatopellan

    How to fix this issue until Microsoft releases the fix via Windows Update. Solution by Rafael David Tinoco (@rafaeldtinoco):

    sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
    sudo apt update
    sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 -y
    sudo apt-mark hold libc6
  9. Kagami commented on Apr 25, 2020

    @Kagami

    Jonathan (@onomatopellan) in case if build-essential is installed it should be:

    sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
    sudo apt update
    sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 libc6-dev=2.31-0ubuntu8+lp1871129~1 libc-dev-bin=2.31-0ubuntu8+lp1871129~1 -y --allow-downgrades
    sudo apt-mark hold libc6
    

    to avoid g++ removal.

    But otherwise it works fine, thanks to you and Rafael David Tinoco (@rafaeldtinoco).

  10. harryqt commented on Apr 25, 2020

    @harryqt

    That worked, thank you very much.

  11. nardocesar commented on Apr 30, 2020

    @nardocesar

    Hey everyone, enabling WSL 2 works for me.

    What I did:

  12. jvoss commented on Apr 30, 2020

    @jvoss

    sudo apt install libc6=2.31-0ubuntu8+lp18711291 libc6-dev=2.31-0ubuntu8+lp18711291 libc-dev-bin=2.31-0ubuntu8+lp1871129~1 -y

    Will result in:

    E: Packages were downgraded and -y was used without --allow-downgrades.
    

    Make sure you add the --allow-downgrades on this step:

    sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 libc6-dev=2.31-0ubuntu8+lp1871129~1 libc-dev-bin=2.31-0ubuntu8+lp1871129~1 -y --allow-downgrades
    
  13. bkraul commented on May 2, 2020

    @bkraul

    I tried this workaround and it did work but I gotta say it seems like a pretty ugly hack. What are the repercussions of holding back libc6? Is there any hope of "cleanup" to where, after installing the needed key and the packages, everything can be put back the way it was?

  14. 44 remaining items

  15. onomatopellan commented on Jul 20, 2020

    @onomatopellan

    janb (@janba12) What's the output of wsl.exe -l -v ?

  16. KevinBurton commented on Jul 23, 2020

    @KevinBurton

    I run into the same issue in trying to install v14 of Nodejs following the steps outlined in this article. It seems that the nodesource_setup.sh script that is downoaded reverses the workaround steps

    sudo apt-get remove gpg
    sudo apt-get install gnupg1
    

    and fails with the same error. Here is version info for me

    PS C:\Users\RKevi> wsl -l -v
      NAME                   STATE           VERSION
    * Ubuntu                 Stopped         1
      docker-desktop-data    Running         2
    
  17. onomatopellan commented on Jul 23, 2020

    @onomatopellan

    Kevin Burton (@KevinBurton) Your Ubuntu distro is still WSL1. You need to convert it to WSL2 with
    wsl.exe --set-version Ubuntu 2
    After that issues like the one in this thread should not happen anymore.

  18. expatjedi commented on Jul 25, 2020

    @expatjedi

    Don't mess up your system by installing / disabling extra programs, just follow the inctructions carefully on micosoft's website. It takes only 5 minutes to apply.

    https://docs.microsoft.com/en-us/windows/wsl/install-win10

  19. janba12 commented on Jul 29, 2020

    @janba12

    The issue i had happened because i was instaling "ubuntu" from Microsoft Store. i just uninstall that one and get Ubuntu 20.04 LTS , that fixed all the issues. thanks for your answers

  20. sgarcia-dev commented on Aug 3, 2020

    @sgarcia-dev

    janb (@janba12): #5125 (comment) worked for me. You might try this:

    sudo apt remove gpg
    sudo apt autoremove --purge -y
    sudo apt install gnupg1

    Thank you! That was much simpler than some of the solutions above, and it worked for me when installing Yarn

  21. NBSOD commented on Aug 5, 2020

    @NBSOD

    How to fix this issue until Microsoft releases the fix via Windows Update. Solution by Rafael David Tinoco (@rafaeldtinoco):

    sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
    sudo apt update
    sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 -y
    sudo apt-mark hold libc6

    this is really good for me! ths!!!! windows 10 2004 , wsl1 Ubuntu 20.04

  22. pkiserver commented on Aug 11, 2020

    @pkiserver

    Ubuntu 20.04
    sudo apt remove gpg
    sudo apt install gnupg1

    I was trying to run as follows:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key
    add -

    And was getting error:
    gpg: can't connect to the agent: IPC connect call failed

    Ran the commands provided > sudo apt remove gpg

    sudo apt install gnupg1 .. and after that the command worked, Thank you

  23. maximelafarie commented on Aug 14, 2020

    @maximelafarie

    Don't mess up your system by installing / disabling extra programs, just follow the inctructions carefully on micosoft's website. It takes only 5 minutes to apply.

    https://docs.microsoft.com/en-us/windows/wsl/install-win10

    Works perfectly (and so true btw, just read the docs 😅) while neither other solution worked for me. Thank you so much! 🤘

    So here are the commands that saved my day:

    wsl --set-default-version 2
    wsl --set-version Ubuntu 2
    wsl --list --verbose
    

    (last command is for checking that Ubuntu is using WSL2)

  24. dimpu204 commented on Aug 18, 2020

    @dimpu204

    I have a fresh installation of Windows 10, and I am trying to get a development environment with WSL set up. I enabled WSL and installed Ubuntu from the Microsoft Store. Everything went smoothly in that process. Then, I tried to go through the steps to install Yarn here.

    When I try to run the first line (curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -), I get the error in the title:

    $ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    gpg: can't connect to the agent: IPC connect call failed
    

    I have looked up this error, and there were a few suggestions related to gpg-agent that I tried, such as manually starting the agent and creating/deleting certain configuration files related to gpg. Everything I tried resulted in the same error above. I am at a loss for what to try next. Has anyone else seen and fixed this issue?

    do sudo apt remove gpg then sudo apt install gnupg1 it worked.

  25. Kyle-Williamson-Dev commented on Aug 21, 2020

    @Kyle-Williamson-Dev

    Jonathan (@onomatopellan) in case if build-essential is installed it should be:

    sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
    sudo apt update
    sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 libc6-dev=2.31-0ubuntu8+lp1871129~1 libc-dev-bin=2.31-0ubuntu8+lp1871129~1 -y --allow-downgrades
    sudo apt-mark hold libc6
    

    to avoid g++ removal.

    But otherwise it works fine, thanks to you and Rafael David Tinoco (@rafaeldtinoco).

    This helped me immensely. I hadn't struggled for long. Once I saw the issue, I googled and luckily found this. It worked for me as now I've been able to install rails.

  26. onomatopellan commented on Sep 8, 2020

    @onomatopellan

    Time to get rid of any workarounds. The fix for WSL1 in Windows 10 v2004 is finally here.

    KB4571756 (OS Build 19041.508)

    Now sleep in Ubuntu 20.04 WSL1 is working just fine.

  27. therealkenc commented on Sep 8, 2020

    @therealkenc

    Workaround discussions (to the extent anyone wants to continue them) can happen over in discussions.

  28. locked and limited conversation to collaborators on Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions