8

How to set a proxy for apt-cyg, http and socks? i tried using

export http_proxy= 

but it did not work.

Tareq Ibrahim
  • 365
  • 5
  • 18
  • 1
    +1 for bringing apt-cyg to my attention – sehe Oct 21 '11 at 15:56
  • I don't know cygwin, but have you tried proxychains or tsocks? Have you tried adding proxy settings in wgetrc that apt-cyg should use? If the nature of apt-cyg is just bash, you might be able to hack it. – MeaCulpa Dec 13 '11 at 14:29

5 Answers5

9

This should work :

export ftp_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
Romain
  • 91
  • 1
  • 2
  • 1
    This is an approppriate answer as of today. `apt-cyg` uses ftp to download packages. – Kosiek May 24 '17 at 10:02
  • Not anymore I guess, I was trying to install busybox and it only worked when I added/exported http/https proxies. @Kosiek – Shayan Oct 05 '22 at 12:13
3

You can also add it all in one line (it works well with cygwin/apt-get embedded in mobaxterm - add it to .bashrc):

export {ftp,http,https}_proxy=http://[user]:[passwd]@[proxy.foo.com]:[port]
TrYde
  • 44
  • 4
1

I'm not sure about Cygwin, but these are the lines from my ~/.bashrc

export http_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export https_proxy=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTP_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]
export HTTPS_PROXY=http://[user]:[passwd]@[proxy.foo.com]:[portnumber]

If cygwin is similar to bash, it should work.

vinaykola
  • 130
  • 6
1

I made it work by setting two Windows environment variables: http_proxy and http_proxy. I previously had HTTP_PROXY, but that wasn't picked up.

Note that as Cygwin is a Windows process, after setting the new environment variables you need to launch a new Cygwin process to pick up the change.

Brian Beckett
  • 4,742
  • 6
  • 33
  • 52
1

Old question, but none of the answers seem right.

From what I can tell trying to UNSET a proxy to run this on one of my boxes, I was getting this error: wget: unable to resolve host address ‘webproxystatic-mywork.com’

Looks like apt-cyg uses wget. So this brings you to this question: setting proxy in wget

The answer of which is: set (or in my case unset) http_proxy/https_proxy in /etc/wgetrc:

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

# If you do not want to use proxy at all, set this to off.
#use_proxy = on
Community
  • 1
  • 1
Marc Brazeau
  • 329
  • 3
  • 8