syntax for SOCKS proxy in apt.conf












18















I want to add SOCKS proxy settings to /etc/apt/apt.conf. What is the syntax for it? Is it same as http and ftp syntax?



Thanks.










share|improve this question



























    18















    I want to add SOCKS proxy settings to /etc/apt/apt.conf. What is the syntax for it? Is it same as http and ftp syntax?



    Thanks.










    share|improve this question

























      18












      18








      18


      11






      I want to add SOCKS proxy settings to /etc/apt/apt.conf. What is the syntax for it? Is it same as http and ftp syntax?



      Thanks.










      share|improve this question














      I want to add SOCKS proxy settings to /etc/apt/apt.conf. What is the syntax for it? Is it same as http and ftp syntax?



      Thanks.







      apt proxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 15 '11 at 10:27









      UbuntuserUbuntuser

      5,8812069115




      5,8812069115






















          5 Answers
          5






          active

          oldest

          votes


















          27














          A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy.
          Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:



          $ sudo -s
          # tsocks apt-get update
          # tsocks apt-get dist-upgrade
          # exit
          $


          or



          $ sudo -s
          # . tsocks -on
          # apt-get update
          # apt-get dist-upgrade
          # . tsocks -off # not really necessary, given the exit
          # exit
          $


          You can think to a number of options, to simplify and automate its use.

          Don't forget the leading dot, the Manpage has more deatails on this.



          Edit: a shorter way to use it:



          $ sudo tsocks apt-get update
          $ sudo tsocks apt-get dist-upgrade





          share|improve this answer





















          • 9





            It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

            – fikr4n
            Apr 12 '16 at 7:21






          • 1





            You can use curl to download tsocks, install it and then use :)

            – neutrinus
            May 20 '16 at 20:38






          • 3





            Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

            – derobert
            Feb 21 '17 at 22:12






          • 1





            Well... that's funny. To make apt-get work you need to... apt-get something!

            – Equidamoid
            Jul 5 '17 at 17:48






          • 2





            a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

            – Alexey Vesnin
            Aug 20 '17 at 11:30



















          6














          Using the next config line works for me:



          Acquire::socks::proxy "socks5://server:port";


          To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.






          share|improve this answer


























          • what's the begin number mean in the foler

            – Kris Roofe
            Dec 29 '16 at 2:14











          • It's just the script execution order

            – Bit-Man
            Dec 30 '16 at 11:48











          • This is wrong. This doesn't work.

            – dedunumax
            Sep 7 '18 at 2:08











          • What failed to you @dedunumax? Any error? Any clue?

            – Bit-Man
            Sep 7 '18 at 15:35













          • Nothing happens.

            – dedunumax
            Sep 7 '18 at 17:52



















          4














          Or tou can put in your /etc/apt/apt.conf something like this:



          Acquire::socks::proxy "socks://user:pass@host:port/";





          share|improve this answer



















          • 2





            This doesn't seem to work in Ubuntu 12.04

            – Shnatsel
            Oct 16 '13 at 17:38











          • Works in 13.10.

            – isaaclw
            May 2 '14 at 4:11






          • 4





            I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

            – Hans-Christoph Steiner
            Jul 18 '14 at 16:03













          • @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

            – Seth Robertson
            Apr 16 '15 at 0:02











          • At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

            – Hans-Christoph Steiner
            Sep 8 '15 at 19:38





















          4














          I couldn't find anything on Acquire::socks::proxy in the apt.conf manual of Ubuntu Xenial. You could fix this by running a local http proxy that supports upstream socks proxy, for example Polipo. You need to configure Polipo as follows:



          proxyAddress = "::1"
          proxyPort = 8118
          socksParentProxy = "sockshost:socksport"
          socksProxyType = socks5


          and then set the http proxy in your apt.conf file:



          Acquire::http::proxy "http://127.0.0.1:8118/";
          Acquire::https::proxy "https://127.0.0.1:8118/";





          share|improve this answer































            0














            Acquire::http::proxy "socks5h://server:port";



            This works for me on Ubuntu 18.04.
            As the man page, socks5h, not socks5, is supported by apt, which means socks5 proxy with dns resolving ability.





            share








            New contributor




            苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              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%2f35223%2fsyntax-for-socks-proxy-in-apt-conf%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              27














              A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy.
              Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:



              $ sudo -s
              # tsocks apt-get update
              # tsocks apt-get dist-upgrade
              # exit
              $


              or



              $ sudo -s
              # . tsocks -on
              # apt-get update
              # apt-get dist-upgrade
              # . tsocks -off # not really necessary, given the exit
              # exit
              $


              You can think to a number of options, to simplify and automate its use.

              Don't forget the leading dot, the Manpage has more deatails on this.



              Edit: a shorter way to use it:



              $ sudo tsocks apt-get update
              $ sudo tsocks apt-get dist-upgrade





              share|improve this answer





















              • 9





                It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

                – fikr4n
                Apr 12 '16 at 7:21






              • 1





                You can use curl to download tsocks, install it and then use :)

                – neutrinus
                May 20 '16 at 20:38






              • 3





                Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

                – derobert
                Feb 21 '17 at 22:12






              • 1





                Well... that's funny. To make apt-get work you need to... apt-get something!

                – Equidamoid
                Jul 5 '17 at 17:48






              • 2





                a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

                – Alexey Vesnin
                Aug 20 '17 at 11:30
















              27














              A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy.
              Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:



              $ sudo -s
              # tsocks apt-get update
              # tsocks apt-get dist-upgrade
              # exit
              $


              or



              $ sudo -s
              # . tsocks -on
              # apt-get update
              # apt-get dist-upgrade
              # . tsocks -off # not really necessary, given the exit
              # exit
              $


              You can think to a number of options, to simplify and automate its use.

              Don't forget the leading dot, the Manpage has more deatails on this.



              Edit: a shorter way to use it:



              $ sudo tsocks apt-get update
              $ sudo tsocks apt-get dist-upgrade





              share|improve this answer





















              • 9





                It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

                – fikr4n
                Apr 12 '16 at 7:21






              • 1





                You can use curl to download tsocks, install it and then use :)

                – neutrinus
                May 20 '16 at 20:38






              • 3





                Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

                – derobert
                Feb 21 '17 at 22:12






              • 1





                Well... that's funny. To make apt-get work you need to... apt-get something!

                – Equidamoid
                Jul 5 '17 at 17:48






              • 2





                a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

                – Alexey Vesnin
                Aug 20 '17 at 11:30














              27












              27








              27







              A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy.
              Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:



              $ sudo -s
              # tsocks apt-get update
              # tsocks apt-get dist-upgrade
              # exit
              $


              or



              $ sudo -s
              # . tsocks -on
              # apt-get update
              # apt-get dist-upgrade
              # . tsocks -off # not really necessary, given the exit
              # exit
              $


              You can think to a number of options, to simplify and automate its use.

              Don't forget the leading dot, the Manpage has more deatails on this.



              Edit: a shorter way to use it:



              $ sudo tsocks apt-get update
              $ sudo tsocks apt-get dist-upgrade





              share|improve this answer















              A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy.
              Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:



              $ sudo -s
              # tsocks apt-get update
              # tsocks apt-get dist-upgrade
              # exit
              $


              or



              $ sudo -s
              # . tsocks -on
              # apt-get update
              # apt-get dist-upgrade
              # . tsocks -off # not really necessary, given the exit
              # exit
              $


              You can think to a number of options, to simplify and automate its use.

              Don't forget the leading dot, the Manpage has more deatails on this.



              Edit: a shorter way to use it:



              $ sudo tsocks apt-get update
              $ sudo tsocks apt-get dist-upgrade






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Feb 17 '14 at 16:10









              Florian Fida

              1053




              1053










              answered Apr 15 '11 at 11:14









              enzotibenzotib

              63.5k6134154




              63.5k6134154








              • 9





                It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

                – fikr4n
                Apr 12 '16 at 7:21






              • 1





                You can use curl to download tsocks, install it and then use :)

                – neutrinus
                May 20 '16 at 20:38






              • 3





                Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

                – derobert
                Feb 21 '17 at 22:12






              • 1





                Well... that's funny. To make apt-get work you need to... apt-get something!

                – Equidamoid
                Jul 5 '17 at 17:48






              • 2





                a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

                – Alexey Vesnin
                Aug 20 '17 at 11:30














              • 9





                It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

                – fikr4n
                Apr 12 '16 at 7:21






              • 1





                You can use curl to download tsocks, install it and then use :)

                – neutrinus
                May 20 '16 at 20:38






              • 3





                Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

                – derobert
                Feb 21 '17 at 22:12






              • 1





                Well... that's funny. To make apt-get work you need to... apt-get something!

                – Equidamoid
                Jul 5 '17 at 17:48






              • 2





                a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

                – Alexey Vesnin
                Aug 20 '17 at 11:30








              9




              9





              It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

              – fikr4n
              Apr 12 '16 at 7:21





              It seems tsocks is not installed by default, so I need to run sudo tsocks apt-get install tsocks. Hahahahahaha...

              – fikr4n
              Apr 12 '16 at 7:21




              1




              1





              You can use curl to download tsocks, install it and then use :)

              – neutrinus
              May 20 '16 at 20:38





              You can use curl to download tsocks, install it and then use :)

              – neutrinus
              May 20 '16 at 20:38




              3




              3





              Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

              – derobert
              Feb 21 '17 at 22:12





              Also: As of apt 1.3~rc1 (Debian version, not sure exactly which Ubuntu version, though my guess is not until Zesty), you can use Acquire::http::Proxy "socks5h://hostname:port/". See the changelog at anonscm.debian.org/gitweb/?p=apt/apt.git;a=blob;f=debian/…

              – derobert
              Feb 21 '17 at 22:12




              1




              1





              Well... that's funny. To make apt-get work you need to... apt-get something!

              – Equidamoid
              Jul 5 '17 at 17:48





              Well... that's funny. To make apt-get work you need to... apt-get something!

              – Equidamoid
              Jul 5 '17 at 17:48




              2




              2





              a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

              – Alexey Vesnin
              Aug 20 '17 at 11:30





              a little correction to @derobert line: Acquire::socks::Proxy "socks5h://hostname:port/"; does the trick. Http does not - try it with Tor and you'll see a standard response "Tor is not a http proxy", so the http goes replaced by socks - and it works!

              – Alexey Vesnin
              Aug 20 '17 at 11:30













              6














              Using the next config line works for me:



              Acquire::socks::proxy "socks5://server:port";


              To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.






              share|improve this answer


























              • what's the begin number mean in the foler

                – Kris Roofe
                Dec 29 '16 at 2:14











              • It's just the script execution order

                – Bit-Man
                Dec 30 '16 at 11:48











              • This is wrong. This doesn't work.

                – dedunumax
                Sep 7 '18 at 2:08











              • What failed to you @dedunumax? Any error? Any clue?

                – Bit-Man
                Sep 7 '18 at 15:35













              • Nothing happens.

                – dedunumax
                Sep 7 '18 at 17:52
















              6














              Using the next config line works for me:



              Acquire::socks::proxy "socks5://server:port";


              To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.






              share|improve this answer


























              • what's the begin number mean in the foler

                – Kris Roofe
                Dec 29 '16 at 2:14











              • It's just the script execution order

                – Bit-Man
                Dec 30 '16 at 11:48











              • This is wrong. This doesn't work.

                – dedunumax
                Sep 7 '18 at 2:08











              • What failed to you @dedunumax? Any error? Any clue?

                – Bit-Man
                Sep 7 '18 at 15:35













              • Nothing happens.

                – dedunumax
                Sep 7 '18 at 17:52














              6












              6








              6







              Using the next config line works for me:



              Acquire::socks::proxy "socks5://server:port";


              To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.






              share|improve this answer















              Using the next config line works for me:



              Acquire::socks::proxy "socks5://server:port";


              To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Sep 29 '15 at 23:16









              kos

              25.6k870121




              25.6k870121










              answered Nov 15 '14 at 17:20









              Bit-ManBit-Man

              19516




              19516













              • what's the begin number mean in the foler

                – Kris Roofe
                Dec 29 '16 at 2:14











              • It's just the script execution order

                – Bit-Man
                Dec 30 '16 at 11:48











              • This is wrong. This doesn't work.

                – dedunumax
                Sep 7 '18 at 2:08











              • What failed to you @dedunumax? Any error? Any clue?

                – Bit-Man
                Sep 7 '18 at 15:35













              • Nothing happens.

                – dedunumax
                Sep 7 '18 at 17:52



















              • what's the begin number mean in the foler

                – Kris Roofe
                Dec 29 '16 at 2:14











              • It's just the script execution order

                – Bit-Man
                Dec 30 '16 at 11:48











              • This is wrong. This doesn't work.

                – dedunumax
                Sep 7 '18 at 2:08











              • What failed to you @dedunumax? Any error? Any clue?

                – Bit-Man
                Sep 7 '18 at 15:35













              • Nothing happens.

                – dedunumax
                Sep 7 '18 at 17:52

















              what's the begin number mean in the foler

              – Kris Roofe
              Dec 29 '16 at 2:14





              what's the begin number mean in the foler

              – Kris Roofe
              Dec 29 '16 at 2:14













              It's just the script execution order

              – Bit-Man
              Dec 30 '16 at 11:48





              It's just the script execution order

              – Bit-Man
              Dec 30 '16 at 11:48













              This is wrong. This doesn't work.

              – dedunumax
              Sep 7 '18 at 2:08





              This is wrong. This doesn't work.

              – dedunumax
              Sep 7 '18 at 2:08













              What failed to you @dedunumax? Any error? Any clue?

              – Bit-Man
              Sep 7 '18 at 15:35







              What failed to you @dedunumax? Any error? Any clue?

              – Bit-Man
              Sep 7 '18 at 15:35















              Nothing happens.

              – dedunumax
              Sep 7 '18 at 17:52





              Nothing happens.

              – dedunumax
              Sep 7 '18 at 17:52











              4














              Or tou can put in your /etc/apt/apt.conf something like this:



              Acquire::socks::proxy "socks://user:pass@host:port/";





              share|improve this answer



















              • 2





                This doesn't seem to work in Ubuntu 12.04

                – Shnatsel
                Oct 16 '13 at 17:38











              • Works in 13.10.

                – isaaclw
                May 2 '14 at 4:11






              • 4





                I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

                – Hans-Christoph Steiner
                Jul 18 '14 at 16:03













              • @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

                – Seth Robertson
                Apr 16 '15 at 0:02











              • At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

                – Hans-Christoph Steiner
                Sep 8 '15 at 19:38


















              4














              Or tou can put in your /etc/apt/apt.conf something like this:



              Acquire::socks::proxy "socks://user:pass@host:port/";





              share|improve this answer



















              • 2





                This doesn't seem to work in Ubuntu 12.04

                – Shnatsel
                Oct 16 '13 at 17:38











              • Works in 13.10.

                – isaaclw
                May 2 '14 at 4:11






              • 4





                I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

                – Hans-Christoph Steiner
                Jul 18 '14 at 16:03













              • @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

                – Seth Robertson
                Apr 16 '15 at 0:02











              • At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

                – Hans-Christoph Steiner
                Sep 8 '15 at 19:38
















              4












              4








              4







              Or tou can put in your /etc/apt/apt.conf something like this:



              Acquire::socks::proxy "socks://user:pass@host:port/";





              share|improve this answer













              Or tou can put in your /etc/apt/apt.conf something like this:



              Acquire::socks::proxy "socks://user:pass@host:port/";






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 1 '12 at 12:34









              mrkbbkmrkbbk

              7311




              7311








              • 2





                This doesn't seem to work in Ubuntu 12.04

                – Shnatsel
                Oct 16 '13 at 17:38











              • Works in 13.10.

                – isaaclw
                May 2 '14 at 4:11






              • 4





                I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

                – Hans-Christoph Steiner
                Jul 18 '14 at 16:03













              • @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

                – Seth Robertson
                Apr 16 '15 at 0:02











              • At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

                – Hans-Christoph Steiner
                Sep 8 '15 at 19:38
















              • 2





                This doesn't seem to work in Ubuntu 12.04

                – Shnatsel
                Oct 16 '13 at 17:38











              • Works in 13.10.

                – isaaclw
                May 2 '14 at 4:11






              • 4





                I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

                – Hans-Christoph Steiner
                Jul 18 '14 at 16:03













              • @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

                – Seth Robertson
                Apr 16 '15 at 0:02











              • At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

                – Hans-Christoph Steiner
                Sep 8 '15 at 19:38










              2




              2





              This doesn't seem to work in Ubuntu 12.04

              – Shnatsel
              Oct 16 '13 at 17:38





              This doesn't seem to work in Ubuntu 12.04

              – Shnatsel
              Oct 16 '13 at 17:38













              Works in 13.10.

              – isaaclw
              May 2 '14 at 4:11





              Works in 13.10.

              – isaaclw
              May 2 '14 at 4:11




              4




              4





              I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

              – Hans-Christoph Steiner
              Jul 18 '14 at 16:03







              I'm pretty sure this is wrong syntax, it means "proxy all URLs that begin with socks:// through socks://user:pass@host:port/". Really, it should be this: Acquire::http::proxy "socks://user:pass@host:port/";

              – Hans-Christoph Steiner
              Jul 18 '14 at 16:03















              @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

              – Seth Robertson
              Apr 16 '15 at 0:02





              @Hans-ChristophSteiner: This makes a connection to the indicated host and port, but the connection does not use the socks protocol. It looks like a http proxy protocol, but I did not check with an actual http proxy.

              – Seth Robertson
              Apr 16 '15 at 0:02













              At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

              – Hans-Christoph Steiner
              Sep 8 '15 at 19:38







              At this point, I'm sure that Acquire::socks is for setting the proxy for URLs that start with socks://. So that means you don't need a proxy to access the internet, and apt is not using any proxy for ftp://, http://, or https://.. apt only supports HTTP proxies, i.e. Acquire::http::proxy "http://localhost:8118.

              – Hans-Christoph Steiner
              Sep 8 '15 at 19:38













              4














              I couldn't find anything on Acquire::socks::proxy in the apt.conf manual of Ubuntu Xenial. You could fix this by running a local http proxy that supports upstream socks proxy, for example Polipo. You need to configure Polipo as follows:



              proxyAddress = "::1"
              proxyPort = 8118
              socksParentProxy = "sockshost:socksport"
              socksProxyType = socks5


              and then set the http proxy in your apt.conf file:



              Acquire::http::proxy "http://127.0.0.1:8118/";
              Acquire::https::proxy "https://127.0.0.1:8118/";





              share|improve this answer




























                4














                I couldn't find anything on Acquire::socks::proxy in the apt.conf manual of Ubuntu Xenial. You could fix this by running a local http proxy that supports upstream socks proxy, for example Polipo. You need to configure Polipo as follows:



                proxyAddress = "::1"
                proxyPort = 8118
                socksParentProxy = "sockshost:socksport"
                socksProxyType = socks5


                and then set the http proxy in your apt.conf file:



                Acquire::http::proxy "http://127.0.0.1:8118/";
                Acquire::https::proxy "https://127.0.0.1:8118/";





                share|improve this answer


























                  4












                  4








                  4







                  I couldn't find anything on Acquire::socks::proxy in the apt.conf manual of Ubuntu Xenial. You could fix this by running a local http proxy that supports upstream socks proxy, for example Polipo. You need to configure Polipo as follows:



                  proxyAddress = "::1"
                  proxyPort = 8118
                  socksParentProxy = "sockshost:socksport"
                  socksProxyType = socks5


                  and then set the http proxy in your apt.conf file:



                  Acquire::http::proxy "http://127.0.0.1:8118/";
                  Acquire::https::proxy "https://127.0.0.1:8118/";





                  share|improve this answer













                  I couldn't find anything on Acquire::socks::proxy in the apt.conf manual of Ubuntu Xenial. You could fix this by running a local http proxy that supports upstream socks proxy, for example Polipo. You need to configure Polipo as follows:



                  proxyAddress = "::1"
                  proxyPort = 8118
                  socksParentProxy = "sockshost:socksport"
                  socksProxyType = socks5


                  and then set the http proxy in your apt.conf file:



                  Acquire::http::proxy "http://127.0.0.1:8118/";
                  Acquire::https::proxy "https://127.0.0.1:8118/";






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 23 '16 at 6:19









                  MosMos

                  14114




                  14114























                      0














                      Acquire::http::proxy "socks5h://server:port";



                      This works for me on Ubuntu 18.04.
                      As the man page, socks5h, not socks5, is supported by apt, which means socks5 proxy with dns resolving ability.





                      share








                      New contributor




                      苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        Acquire::http::proxy "socks5h://server:port";



                        This works for me on Ubuntu 18.04.
                        As the man page, socks5h, not socks5, is supported by apt, which means socks5 proxy with dns resolving ability.





                        share








                        New contributor




                        苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          Acquire::http::proxy "socks5h://server:port";



                          This works for me on Ubuntu 18.04.
                          As the man page, socks5h, not socks5, is supported by apt, which means socks5 proxy with dns resolving ability.





                          share








                          New contributor




                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          Acquire::http::proxy "socks5h://server:port";



                          This works for me on Ubuntu 18.04.
                          As the man page, socks5h, not socks5, is supported by apt, which means socks5 proxy with dns resolving ability.






                          share








                          New contributor




                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          share


                          share






                          New contributor




                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 3 mins ago









                          苏永刚苏永刚

                          1




                          1




                          New contributor




                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          苏永刚 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              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%2f35223%2fsyntax-for-socks-proxy-in-apt-conf%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

                              香粉寮

                              GameSpot