How do I add a repository from behind a proxy?












14















I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:




Error reading --some url here--: urlopen error [Errno 113] No route to host




I've tried with




  • Launchpad-getkeys script. I get this (image)


enter image description here





  • I've tried with another "hack", without luck




    1. Press Alt-F2 and type gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py

    2. Find line 88, change keyserver.ubuntu.com to hkp://keyserver.ubuntu.com:80

    3. Save, close and reboot.




Does anyone know if I could solve this problem in any way? Thanks










share|improve this question





























    14















    I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:




    Error reading --some url here--: urlopen error [Errno 113] No route to host




    I've tried with




    • Launchpad-getkeys script. I get this (image)


    enter image description here





    • I've tried with another "hack", without luck




      1. Press Alt-F2 and type gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py

      2. Find line 88, change keyserver.ubuntu.com to hkp://keyserver.ubuntu.com:80

      3. Save, close and reboot.




    Does anyone know if I could solve this problem in any way? Thanks










    share|improve this question



























      14












      14








      14


      5






      I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:




      Error reading --some url here--: urlopen error [Errno 113] No route to host




      I've tried with




      • Launchpad-getkeys script. I get this (image)


      enter image description here





      • I've tried with another "hack", without luck




        1. Press Alt-F2 and type gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py

        2. Find line 88, change keyserver.ubuntu.com to hkp://keyserver.ubuntu.com:80

        3. Save, close and reboot.




      Does anyone know if I could solve this problem in any way? Thanks










      share|improve this question
















      I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:




      Error reading --some url here--: urlopen error [Errno 113] No route to host




      I've tried with




      • Launchpad-getkeys script. I get this (image)


      enter image description here





      • I've tried with another "hack", without luck




        1. Press Alt-F2 and type gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py

        2. Find line 88, change keyserver.ubuntu.com to hkp://keyserver.ubuntu.com:80

        3. Save, close and reboot.




      Does anyone know if I could solve this problem in any way? Thanks







      command-line proxy gnupg add-apt-repository






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 '12 at 17:16









      Jorge Castro

      36.8k106422617




      36.8k106422617










      asked Jan 25 '11 at 14:00









      EnriqueEnrique

      2071213




      2071213






















          4 Answers
          4






          active

          oldest

          votes


















          13














          Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:




          1. Set the variable https_proxy to your proxy


          2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:



            Defaults env_keep = https_proxy







          share|improve this answer


























          • Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

            – Enrique
            Jan 26 '11 at 11:56



















          1














          The script you've mentioned - launchpad-getkeys now has proxy support.






          share|improve this answer
























          • Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

            – Enrique
            Feb 22 '11 at 17:00



















          1














          Use the -HE option of sudo:



          sudo -HE apt-key [...]


          It will keep your proxy settings






          share|improve this answer































            0














            You have to enter the root account and add the repository from there:



            sudo su
            add-apt-repository ppa:xxxyyy/ppa





            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              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%2faskubuntu.com%2fquestions%2f23211%2fhow-do-i-add-a-repository-from-behind-a-proxy%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              13














              Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:




              1. Set the variable https_proxy to your proxy


              2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:



                Defaults env_keep = https_proxy







              share|improve this answer


























              • Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

                – Enrique
                Jan 26 '11 at 11:56
















              13














              Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:




              1. Set the variable https_proxy to your proxy


              2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:



                Defaults env_keep = https_proxy







              share|improve this answer


























              • Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

                – Enrique
                Jan 26 '11 at 11:56














              13












              13








              13







              Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:




              1. Set the variable https_proxy to your proxy


              2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:



                Defaults env_keep = https_proxy







              share|improve this answer















              Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:




              1. Set the variable https_proxy to your proxy


              2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:



                Defaults env_keep = https_proxy








              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 10 '15 at 17:07









              Eric Carvalho

              42k17115147




              42k17115147










              answered Jan 25 '11 at 18:30









              João PintoJoão Pinto

              14.8k34660




              14.8k34660













              • Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

                – Enrique
                Jan 26 '11 at 11:56



















              • Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

                – Enrique
                Jan 26 '11 at 11:56

















              Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

              – Enrique
              Jan 26 '11 at 11:56





              Joao, I've added variables to /home/myuser/.bashrc, then added the env_keep stuff to /etc/sudoers, and now when I execute this command "sudo env | grep proxy" I get the variables showing. When I add a repository or execute the launchpad-getkeys script, I don't get errors anymore. THANKS!!

              – Enrique
              Jan 26 '11 at 11:56













              1














              The script you've mentioned - launchpad-getkeys now has proxy support.






              share|improve this answer
























              • Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

                – Enrique
                Feb 22 '11 at 17:00
















              1














              The script you've mentioned - launchpad-getkeys now has proxy support.






              share|improve this answer
























              • Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

                – Enrique
                Feb 22 '11 at 17:00














              1












              1








              1







              The script you've mentioned - launchpad-getkeys now has proxy support.






              share|improve this answer













              The script you've mentioned - launchpad-getkeys now has proxy support.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Feb 21 '11 at 19:18









              Alin AndreiAlin Andrei

              7,00433554




              7,00433554













              • Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

                – Enrique
                Feb 22 '11 at 17:00



















              • Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

                – Enrique
                Feb 22 '11 at 17:00

















              Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

              – Enrique
              Feb 22 '11 at 17:00





              Although I solved the question with the /etc/sudoers, I also read the launchpad-getkeys news in the rss feed, and now with -p ip:port this is an awesome feature! thanks Alin !!

              – Enrique
              Feb 22 '11 at 17:00











              1














              Use the -HE option of sudo:



              sudo -HE apt-key [...]


              It will keep your proxy settings






              share|improve this answer




























                1














                Use the -HE option of sudo:



                sudo -HE apt-key [...]


                It will keep your proxy settings






                share|improve this answer


























                  1












                  1








                  1







                  Use the -HE option of sudo:



                  sudo -HE apt-key [...]


                  It will keep your proxy settings






                  share|improve this answer













                  Use the -HE option of sudo:



                  sudo -HE apt-key [...]


                  It will keep your proxy settings







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 31 '17 at 14:04









                  user4780495user4780495

                  23125




                  23125























                      0














                      You have to enter the root account and add the repository from there:



                      sudo su
                      add-apt-repository ppa:xxxyyy/ppa





                      share|improve this answer






























                        0














                        You have to enter the root account and add the repository from there:



                        sudo su
                        add-apt-repository ppa:xxxyyy/ppa





                        share|improve this answer




























                          0












                          0








                          0







                          You have to enter the root account and add the repository from there:



                          sudo su
                          add-apt-repository ppa:xxxyyy/ppa





                          share|improve this answer















                          You have to enter the root account and add the repository from there:



                          sudo su
                          add-apt-repository ppa:xxxyyy/ppa






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jun 5 '14 at 6:49









                          Luís de Sousa

                          9,1961752102




                          9,1961752102










                          answered Jun 5 '14 at 6:28









                          waweruwaweru

                          181117




                          181117






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • 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%2faskubuntu.com%2fquestions%2f23211%2fhow-do-i-add-a-repository-from-behind-a-proxy%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

                              flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                              Mangá

                              Eduardo VII do Reino Unido