keyserver timed out when trying to add a GPG public key

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
56
down vote

favorite
27












I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error:



gpg --keyserver keyserver.ubuntu.com --recv-keys 94558F59
gpg: requesting key 94558F59 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error


How is this possible it seems that the I am behind some kind of blockade which makes it impossible to establish a connection to the key server. I looked into many OP questions and tried all commands I could find but nothing worked. Anyone had this problem before?










share|improve this question























  • Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
    – jasonwryan
    May 15 '13 at 8:58










  • @jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
    – Sander Van der Zeeuw
    May 15 '13 at 9:01










  • Use the full address, and the alternate port...
    – jasonwryan
    May 15 '13 at 9:04










  • @jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
    – Sander Van der Zeeuw
    May 15 '13 at 9:09






  • 3




    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
    – jasonwryan
    May 15 '13 at 9:20














up vote
56
down vote

favorite
27












I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error:



gpg --keyserver keyserver.ubuntu.com --recv-keys 94558F59
gpg: requesting key 94558F59 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error


How is this possible it seems that the I am behind some kind of blockade which makes it impossible to establish a connection to the key server. I looked into many OP questions and tried all commands I could find but nothing worked. Anyone had this problem before?










share|improve this question























  • Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
    – jasonwryan
    May 15 '13 at 8:58










  • @jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
    – Sander Van der Zeeuw
    May 15 '13 at 9:01










  • Use the full address, and the alternate port...
    – jasonwryan
    May 15 '13 at 9:04










  • @jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
    – Sander Van der Zeeuw
    May 15 '13 at 9:09






  • 3




    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
    – jasonwryan
    May 15 '13 at 9:20












up vote
56
down vote

favorite
27









up vote
56
down vote

favorite
27






27





I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error:



gpg --keyserver keyserver.ubuntu.com --recv-keys 94558F59
gpg: requesting key 94558F59 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error


How is this possible it seems that the I am behind some kind of blockade which makes it impossible to establish a connection to the key server. I looked into many OP questions and tried all commands I could find but nothing worked. Anyone had this problem before?










share|improve this question















I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error:



gpg --keyserver keyserver.ubuntu.com --recv-keys 94558F59
gpg: requesting key 94558F59 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error


How is this possible it seems that the I am behind some kind of blockade which makes it impossible to establish a connection to the key server. I looked into many OP questions and tried all commands I could find but nothing worked. Anyone had this problem before?







bash ubuntu gpg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 7 '17 at 14:11









Jeff Schaller

37.4k1052121




37.4k1052121










asked May 15 '13 at 8:49









Sander Van der Zeeuw

5412614




5412614











  • Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
    – jasonwryan
    May 15 '13 at 8:58










  • @jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
    – Sander Van der Zeeuw
    May 15 '13 at 9:01










  • Use the full address, and the alternate port...
    – jasonwryan
    May 15 '13 at 9:04










  • @jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
    – Sander Van der Zeeuw
    May 15 '13 at 9:09






  • 3




    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
    – jasonwryan
    May 15 '13 at 9:20
















  • Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
    – jasonwryan
    May 15 '13 at 8:58










  • @jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
    – Sander Van der Zeeuw
    May 15 '13 at 9:01










  • Use the full address, and the alternate port...
    – jasonwryan
    May 15 '13 at 9:04










  • @jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
    – Sander Van der Zeeuw
    May 15 '13 at 9:09






  • 3




    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
    – jasonwryan
    May 15 '13 at 9:20















Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
– jasonwryan
May 15 '13 at 8:58




Have you tried using another keyserver? hkp://subkeys.pgp.net or hkp://pgp.mit.edu:11371
– jasonwryan
May 15 '13 at 8:58












@jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
– Sander Van der Zeeuw
May 15 '13 at 9:01




@jasonwryan Ive tried the pgp.mit.edu but without hkp:// is the use of that important? i dont believe so but its worth trying for me
– Sander Van der Zeeuw
May 15 '13 at 9:01












Use the full address, and the alternate port...
– jasonwryan
May 15 '13 at 9:04




Use the full address, and the alternate port...
– jasonwryan
May 15 '13 at 9:04












@jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
– Sander Van der Zeeuw
May 15 '13 at 9:09




@jasonwryan I still got ?: pgp.mit.edu: Connection timed out gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out gpg: no valid OpenPGP data found. gpg: Total number processed: 0
– Sander Van der Zeeuw
May 15 '13 at 9:09




3




3




gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
– jasonwryan
May 15 '13 at 9:20




gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59 worked for me...
– jasonwryan
May 15 '13 at 9:20










8 Answers
8






active

oldest

votes

















up vote
94
down vote



accepted










This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could either:




  1. Force it to use port 80 instead of 11371



    gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59



  2. Alternatively



    • Find and open the key from the key server.

    • Copy it's contents into a text file.

    • Go to System Tool > Preferences > Software Sources > Authentication > Add key, and select the text file created. For Ubuntu 14.04 and later try: Software Center -> Edit -> Software Sources -> Authentication -> Import key file






share|improve this answer


















  • 5




    gpg --import key.txt if you need to import via command line FYI.
    – Banjer
    Nov 4 '14 at 18:28







  • 1




    sks-keyservers.net/i to download the key FYI
    – Lakshmi Narayanan
    Aug 17 '15 at 20:01







  • 2




    upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
    – Roy Ling
    Nov 10 '15 at 1:36











  • This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
    – mdgrech
    Jun 8 '16 at 17:58






  • 4




    "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
    – Ben Johnson
    Jul 13 '16 at 21:18

















up vote
18
down vote













sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY






share|improve this answer
















  • 6




    sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
    – jasonwryan
    Nov 6 '13 at 19:45






  • 4




    I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
    – Victor Piousbox
    Nov 6 '13 at 20:31







  • 5




    Remove the sudo and the answer is correct.
    – jasonwryan
    Nov 6 '13 at 20:55






  • 4




    Necessary to recieve keys from a public keyserver? I don't think so...
    – jasonwryan
    Nov 7 '13 at 1:57






  • 2




    Adding the hkp:// as noted in this answer does work for me.
    – barryhunter
    Apr 21 '16 at 12:11

















up vote
9
down vote













This worked for me:



sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys AKEYXXX





share|improve this answer






















  • I love you man !
    – Yasser Sinjab
    Oct 25 '17 at 13:53

















up vote
5
down vote













I encountered same problem when I was trying to add a GPG key behind a proxy. The solution to my problem was to add the --keyserver-options in the command:



sudo apt-key adv --keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY





share|improve this answer





























    up vote
    1
    down vote













    Try getting your key from another server (worked for me):



    gpg --keyserver hkp://keys.gnupg.net --recv-keys 94558F59


    or



    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59





    share|improve this answer



























      up vote
      0
      down vote













      I'm seeing this on one of two identical boxes running ansible deployments against an ubuntu 14.04 image. In fact, it had previously worked for app-infra-1 but at some point it began to fail. The fact that it succeeded on app-infra-2 freshly recreated suggests it is a corruption on app-infra-1 or a bug in the detection and reporting of apt-key adv.



      I tried deleting the key using apt-key del but I continue to get the same error.



      changed: [app-infra-2] => "changed": true, "item": "", "repo": "ppa:webupd8team/java", "state": "present"
      failed: [app-infra-1] => "cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "item": "", "rc": 2
      stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
      gpg: keyserver timed out
      gpg: keyserver receive failed: keyserver error

      stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.2zqQuFdBjg --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886

      msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
      gpg: keyserver timed out
      gpg: keyserver receive failed: keyserver error


      In the end, since it's a vm, my solution was to re-build it with vagrant.






      share|improve this answer





























        up vote
        0
        down vote













        For me it was required to add ENV statements into my docker file. E.g.



        ENV http_proxy "http://[yourproxy]:[port]/"
        ENV https_proxy "http://[yourproxy]:[port]/"





        share|improve this answer





























          up vote
          0
          down vote













          I fixed my problem by running the following command:



          sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys *somekey*






          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f75892%2fkeyserver-timed-out-when-trying-to-add-a-gpg-public-key%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            8 Answers
            8






            active

            oldest

            votes








            8 Answers
            8






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            94
            down vote



            accepted










            This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could either:




            1. Force it to use port 80 instead of 11371



              gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59



            2. Alternatively



              • Find and open the key from the key server.

              • Copy it's contents into a text file.

              • Go to System Tool > Preferences > Software Sources > Authentication > Add key, and select the text file created. For Ubuntu 14.04 and later try: Software Center -> Edit -> Software Sources -> Authentication -> Import key file






            share|improve this answer


















            • 5




              gpg --import key.txt if you need to import via command line FYI.
              – Banjer
              Nov 4 '14 at 18:28







            • 1




              sks-keyservers.net/i to download the key FYI
              – Lakshmi Narayanan
              Aug 17 '15 at 20:01







            • 2




              upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
              – Roy Ling
              Nov 10 '15 at 1:36











            • This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
              – mdgrech
              Jun 8 '16 at 17:58






            • 4




              "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
              – Ben Johnson
              Jul 13 '16 at 21:18














            up vote
            94
            down vote



            accepted










            This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could either:




            1. Force it to use port 80 instead of 11371



              gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59



            2. Alternatively



              • Find and open the key from the key server.

              • Copy it's contents into a text file.

              • Go to System Tool > Preferences > Software Sources > Authentication > Add key, and select the text file created. For Ubuntu 14.04 and later try: Software Center -> Edit -> Software Sources -> Authentication -> Import key file






            share|improve this answer


















            • 5




              gpg --import key.txt if you need to import via command line FYI.
              – Banjer
              Nov 4 '14 at 18:28







            • 1




              sks-keyservers.net/i to download the key FYI
              – Lakshmi Narayanan
              Aug 17 '15 at 20:01







            • 2




              upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
              – Roy Ling
              Nov 10 '15 at 1:36











            • This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
              – mdgrech
              Jun 8 '16 at 17:58






            • 4




              "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
              – Ben Johnson
              Jul 13 '16 at 21:18












            up vote
            94
            down vote



            accepted







            up vote
            94
            down vote



            accepted






            This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could either:




            1. Force it to use port 80 instead of 11371



              gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59



            2. Alternatively



              • Find and open the key from the key server.

              • Copy it's contents into a text file.

              • Go to System Tool > Preferences > Software Sources > Authentication > Add key, and select the text file created. For Ubuntu 14.04 and later try: Software Center -> Edit -> Software Sources -> Authentication -> Import key file






            share|improve this answer














            This is usually caused by your firewall blocking the port 11371. You could unblock the port in your firewall. In case you don't have access to the firewall you could either:




            1. Force it to use port 80 instead of 11371



              gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59



            2. Alternatively



              • Find and open the key from the key server.

              • Copy it's contents into a text file.

              • Go to System Tool > Preferences > Software Sources > Authentication > Add key, and select the text file created. For Ubuntu 14.04 and later try: Software Center -> Edit -> Software Sources -> Authentication -> Import key file







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 30 at 7:50

























            answered Jan 23 '14 at 14:07









            tutak

            1,05675




            1,05675







            • 5




              gpg --import key.txt if you need to import via command line FYI.
              – Banjer
              Nov 4 '14 at 18:28







            • 1




              sks-keyservers.net/i to download the key FYI
              – Lakshmi Narayanan
              Aug 17 '15 at 20:01







            • 2




              upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
              – Roy Ling
              Nov 10 '15 at 1:36











            • This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
              – mdgrech
              Jun 8 '16 at 17:58






            • 4




              "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
              – Ben Johnson
              Jul 13 '16 at 21:18












            • 5




              gpg --import key.txt if you need to import via command line FYI.
              – Banjer
              Nov 4 '14 at 18:28







            • 1




              sks-keyservers.net/i to download the key FYI
              – Lakshmi Narayanan
              Aug 17 '15 at 20:01







            • 2




              upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
              – Roy Ling
              Nov 10 '15 at 1:36











            • This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
              – mdgrech
              Jun 8 '16 at 17:58






            • 4




              "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
              – Ben Johnson
              Jul 13 '16 at 21:18







            5




            5




            gpg --import key.txt if you need to import via command line FYI.
            – Banjer
            Nov 4 '14 at 18:28





            gpg --import key.txt if you need to import via command line FYI.
            – Banjer
            Nov 4 '14 at 18:28





            1




            1




            sks-keyservers.net/i to download the key FYI
            – Lakshmi Narayanan
            Aug 17 '15 at 20:01





            sks-keyservers.net/i to download the key FYI
            – Lakshmi Narayanan
            Aug 17 '15 at 20:01





            2




            2




            upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
            – Roy Ling
            Nov 10 '15 at 1:36





            upvote for alternative way! On Ubuntu 14.04 and later, it's added from Software Center -> Edit -> Software Sources -> Authentication -> Import key file
            – Roy Ling
            Nov 10 '15 at 1:36













            This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
            – mdgrech
            Jun 8 '16 at 17:58




            This fixed my issue w/ install the keys for rvm. The following call was hanging for me: requesting key D39DC0E3 from hkp server keys.gnupg.net
            – mdgrech
            Jun 8 '16 at 17:58




            4




            4




            "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
            – Ben Johnson
            Jul 13 '16 at 21:18




            "Find and open the key from the key server." What nobody mentions is how that's done. In my case, the key in question is on gpg.mit.edu. Okay, easy, just go to pgp.mit.edu and paste the key into the Search String field! Wrong. You must know the magic secret: prepend the key with 0x. If the key is 0F571F6C, you must search for 0x0F571F6C, which is in no way obvious.
            – Ben Johnson
            Jul 13 '16 at 21:18












            up vote
            18
            down vote













            sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY






            share|improve this answer
















            • 6




              sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
              – jasonwryan
              Nov 6 '13 at 19:45






            • 4




              I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
              – Victor Piousbox
              Nov 6 '13 at 20:31







            • 5




              Remove the sudo and the answer is correct.
              – jasonwryan
              Nov 6 '13 at 20:55






            • 4




              Necessary to recieve keys from a public keyserver? I don't think so...
              – jasonwryan
              Nov 7 '13 at 1:57






            • 2




              Adding the hkp:// as noted in this answer does work for me.
              – barryhunter
              Apr 21 '16 at 12:11














            up vote
            18
            down vote













            sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY






            share|improve this answer
















            • 6




              sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
              – jasonwryan
              Nov 6 '13 at 19:45






            • 4




              I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
              – Victor Piousbox
              Nov 6 '13 at 20:31







            • 5




              Remove the sudo and the answer is correct.
              – jasonwryan
              Nov 6 '13 at 20:55






            • 4




              Necessary to recieve keys from a public keyserver? I don't think so...
              – jasonwryan
              Nov 7 '13 at 1:57






            • 2




              Adding the hkp:// as noted in this answer does work for me.
              – barryhunter
              Apr 21 '16 at 12:11












            up vote
            18
            down vote










            up vote
            18
            down vote









            sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY






            share|improve this answer












            sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 6 '13 at 18:49









            Victor Piousbox

            31226




            31226







            • 6




              sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
              – jasonwryan
              Nov 6 '13 at 19:45






            • 4




              I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
              – Victor Piousbox
              Nov 6 '13 at 20:31







            • 5




              Remove the sudo and the answer is correct.
              – jasonwryan
              Nov 6 '13 at 20:55






            • 4




              Necessary to recieve keys from a public keyserver? I don't think so...
              – jasonwryan
              Nov 7 '13 at 1:57






            • 2




              Adding the hkp:// as noted in this answer does work for me.
              – barryhunter
              Apr 21 '16 at 12:11












            • 6




              sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
              – jasonwryan
              Nov 6 '13 at 19:45






            • 4




              I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
              – Victor Piousbox
              Nov 6 '13 at 20:31







            • 5




              Remove the sudo and the answer is correct.
              – jasonwryan
              Nov 6 '13 at 20:55






            • 4




              Necessary to recieve keys from a public keyserver? I don't think so...
              – jasonwryan
              Nov 7 '13 at 1:57






            • 2




              Adding the hkp:// as noted in this answer does work for me.
              – barryhunter
              Apr 21 '16 at 12:11







            6




            6




            sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
            – jasonwryan
            Nov 6 '13 at 19:45




            sudo is not necessary and, other than that, this answer adds nothing to the poster's problem...
            – jasonwryan
            Nov 6 '13 at 19:45




            4




            4




            I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
            – Victor Piousbox
            Nov 6 '13 at 20:31





            I was working on this just an hour ago, and adding this line solved the problem for me. There is the difference that I specify port 80 explicitly. I also specify the protocol explicitly. You may be right that sudo is not needed, but my answer does ad a bit of relevant info, don't you think? Oh and, your answer is also correct.
            – Victor Piousbox
            Nov 6 '13 at 20:31





            5




            5




            Remove the sudo and the answer is correct.
            – jasonwryan
            Nov 6 '13 at 20:55




            Remove the sudo and the answer is correct.
            – jasonwryan
            Nov 6 '13 at 20:55




            4




            4




            Necessary to recieve keys from a public keyserver? I don't think so...
            – jasonwryan
            Nov 7 '13 at 1:57




            Necessary to recieve keys from a public keyserver? I don't think so...
            – jasonwryan
            Nov 7 '13 at 1:57




            2




            2




            Adding the hkp:// as noted in this answer does work for me.
            – barryhunter
            Apr 21 '16 at 12:11




            Adding the hkp:// as noted in this answer does work for me.
            – barryhunter
            Apr 21 '16 at 12:11










            up vote
            9
            down vote













            This worked for me:



            sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys AKEYXXX





            share|improve this answer






















            • I love you man !
              – Yasser Sinjab
              Oct 25 '17 at 13:53














            up vote
            9
            down vote













            This worked for me:



            sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys AKEYXXX





            share|improve this answer






















            • I love you man !
              – Yasser Sinjab
              Oct 25 '17 at 13:53












            up vote
            9
            down vote










            up vote
            9
            down vote









            This worked for me:



            sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys AKEYXXX





            share|improve this answer














            This worked for me:



            sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys AKEYXXX






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 8 '17 at 22:20









            Lelouch Lamperouge

            3,49431011




            3,49431011










            answered May 9 '14 at 17:18









            eltoro56

            9111




            9111











            • I love you man !
              – Yasser Sinjab
              Oct 25 '17 at 13:53
















            • I love you man !
              – Yasser Sinjab
              Oct 25 '17 at 13:53















            I love you man !
            – Yasser Sinjab
            Oct 25 '17 at 13:53




            I love you man !
            – Yasser Sinjab
            Oct 25 '17 at 13:53










            up vote
            5
            down vote













            I encountered same problem when I was trying to add a GPG key behind a proxy. The solution to my problem was to add the --keyserver-options in the command:



            sudo apt-key adv --keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY





            share|improve this answer


























              up vote
              5
              down vote













              I encountered same problem when I was trying to add a GPG key behind a proxy. The solution to my problem was to add the --keyserver-options in the command:



              sudo apt-key adv --keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY





              share|improve this answer
























                up vote
                5
                down vote










                up vote
                5
                down vote









                I encountered same problem when I was trying to add a GPG key behind a proxy. The solution to my problem was to add the --keyserver-options in the command:



                sudo apt-key adv --keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY





                share|improve this answer














                I encountered same problem when I was trying to add a GPG key behind a proxy. The solution to my problem was to add the --keyserver-options in the command:



                sudo apt-key adv --keyserver-options http-proxy=http://USER:PASSWORD@PROXY_URL:PORT/ --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 13 '17 at 12:22









                Community

                1




                1










                answered Jul 19 '16 at 0:39









                Alex.Bai

                5113




                5113




















                    up vote
                    1
                    down vote













                    Try getting your key from another server (worked for me):



                    gpg --keyserver hkp://keys.gnupg.net --recv-keys 94558F59


                    or



                    gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59





                    share|improve this answer
























                      up vote
                      1
                      down vote













                      Try getting your key from another server (worked for me):



                      gpg --keyserver hkp://keys.gnupg.net --recv-keys 94558F59


                      or



                      gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59





                      share|improve this answer






















                        up vote
                        1
                        down vote










                        up vote
                        1
                        down vote









                        Try getting your key from another server (worked for me):



                        gpg --keyserver hkp://keys.gnupg.net --recv-keys 94558F59


                        or



                        gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59





                        share|improve this answer












                        Try getting your key from another server (worked for me):



                        gpg --keyserver hkp://keys.gnupg.net --recv-keys 94558F59


                        or



                        gpg --keyserver hkp://pgp.mit.edu --recv-keys 94558F59






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Aug 15 '15 at 15:17









                        installero

                        1113




                        1113




















                            up vote
                            0
                            down vote













                            I'm seeing this on one of two identical boxes running ansible deployments against an ubuntu 14.04 image. In fact, it had previously worked for app-infra-1 but at some point it began to fail. The fact that it succeeded on app-infra-2 freshly recreated suggests it is a corruption on app-infra-1 or a bug in the detection and reporting of apt-key adv.



                            I tried deleting the key using apt-key del but I continue to get the same error.



                            changed: [app-infra-2] => "changed": true, "item": "", "repo": "ppa:webupd8team/java", "state": "present"
                            failed: [app-infra-1] => "cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "item": "", "rc": 2
                            stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                            gpg: keyserver timed out
                            gpg: keyserver receive failed: keyserver error

                            stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.2zqQuFdBjg --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886

                            msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                            gpg: keyserver timed out
                            gpg: keyserver receive failed: keyserver error


                            In the end, since it's a vm, my solution was to re-build it with vagrant.






                            share|improve this answer


























                              up vote
                              0
                              down vote













                              I'm seeing this on one of two identical boxes running ansible deployments against an ubuntu 14.04 image. In fact, it had previously worked for app-infra-1 but at some point it began to fail. The fact that it succeeded on app-infra-2 freshly recreated suggests it is a corruption on app-infra-1 or a bug in the detection and reporting of apt-key adv.



                              I tried deleting the key using apt-key del but I continue to get the same error.



                              changed: [app-infra-2] => "changed": true, "item": "", "repo": "ppa:webupd8team/java", "state": "present"
                              failed: [app-infra-1] => "cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "item": "", "rc": 2
                              stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                              gpg: keyserver timed out
                              gpg: keyserver receive failed: keyserver error

                              stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.2zqQuFdBjg --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886

                              msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                              gpg: keyserver timed out
                              gpg: keyserver receive failed: keyserver error


                              In the end, since it's a vm, my solution was to re-build it with vagrant.






                              share|improve this answer
























                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote









                                I'm seeing this on one of two identical boxes running ansible deployments against an ubuntu 14.04 image. In fact, it had previously worked for app-infra-1 but at some point it began to fail. The fact that it succeeded on app-infra-2 freshly recreated suggests it is a corruption on app-infra-1 or a bug in the detection and reporting of apt-key adv.



                                I tried deleting the key using apt-key del but I continue to get the same error.



                                changed: [app-infra-2] => "changed": true, "item": "", "repo": "ppa:webupd8team/java", "state": "present"
                                failed: [app-infra-1] => "cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "item": "", "rc": 2
                                stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                                gpg: keyserver timed out
                                gpg: keyserver receive failed: keyserver error

                                stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.2zqQuFdBjg --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886

                                msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                                gpg: keyserver timed out
                                gpg: keyserver receive failed: keyserver error


                                In the end, since it's a vm, my solution was to re-build it with vagrant.






                                share|improve this answer














                                I'm seeing this on one of two identical boxes running ansible deployments against an ubuntu 14.04 image. In fact, it had previously worked for app-infra-1 but at some point it began to fail. The fact that it succeeded on app-infra-2 freshly recreated suggests it is a corruption on app-infra-1 or a bug in the detection and reporting of apt-key adv.



                                I tried deleting the key using apt-key del but I continue to get the same error.



                                changed: [app-infra-2] => "changed": true, "item": "", "repo": "ppa:webupd8team/java", "state": "present"
                                failed: [app-infra-1] => "cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "item": "", "rc": 2
                                stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                                gpg: keyserver timed out
                                gpg: keyserver receive failed: keyserver error

                                stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.2zqQuFdBjg --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886

                                msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
                                gpg: keyserver timed out
                                gpg: keyserver receive failed: keyserver error


                                In the end, since it's a vm, my solution was to re-build it with vagrant.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited May 28 '14 at 20:20









                                drs

                                3,29352858




                                3,29352858










                                answered May 28 '14 at 19:00









                                darKoram

                                17114




                                17114




















                                    up vote
                                    0
                                    down vote













                                    For me it was required to add ENV statements into my docker file. E.g.



                                    ENV http_proxy "http://[yourproxy]:[port]/"
                                    ENV https_proxy "http://[yourproxy]:[port]/"





                                    share|improve this answer


























                                      up vote
                                      0
                                      down vote













                                      For me it was required to add ENV statements into my docker file. E.g.



                                      ENV http_proxy "http://[yourproxy]:[port]/"
                                      ENV https_proxy "http://[yourproxy]:[port]/"





                                      share|improve this answer
























                                        up vote
                                        0
                                        down vote










                                        up vote
                                        0
                                        down vote









                                        For me it was required to add ENV statements into my docker file. E.g.



                                        ENV http_proxy "http://[yourproxy]:[port]/"
                                        ENV https_proxy "http://[yourproxy]:[port]/"





                                        share|improve this answer














                                        For me it was required to add ENV statements into my docker file. E.g.



                                        ENV http_proxy "http://[yourproxy]:[port]/"
                                        ENV https_proxy "http://[yourproxy]:[port]/"






                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Nov 16 '15 at 10:05









                                        Sparhawk

                                        9,09063889




                                        9,09063889










                                        answered Nov 16 '15 at 9:41









                                        TExaaS-Bikepro

                                        1




                                        1




















                                            up vote
                                            0
                                            down vote













                                            I fixed my problem by running the following command:



                                            sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys *somekey*






                                            share|improve this answer
























                                              up vote
                                              0
                                              down vote













                                              I fixed my problem by running the following command:



                                              sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys *somekey*






                                              share|improve this answer






















                                                up vote
                                                0
                                                down vote










                                                up vote
                                                0
                                                down vote









                                                I fixed my problem by running the following command:



                                                sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys *somekey*






                                                share|improve this answer












                                                I fixed my problem by running the following command:



                                                sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys *somekey*







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Jan 21 at 19:40









                                                Hadi Rasekh

                                                1011




                                                1011



























                                                    draft saved

                                                    draft discarded
















































                                                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid


                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.

                                                    To learn more, see our tips on writing great answers.





                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                    Please pay close attention to the following guidance:


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid


                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.

                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f75892%2fkeyserver-timed-out-when-trying-to-add-a-gpg-public-key%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown






                                                    Popular posts from this blog

                                                    How to check contact read email or not when send email to Individual?

                                                    Bahrain

                                                    Postfix configuration issue with fips on centos 7; mailgun relay