Although this question relates to Raspbian running on my Raspberry Pi, it feels like it is a more general Linux query....

The Pi is sat on a network which includes a Microsoft TMG server. I have created a 01proxy file in /etc/apt/apt.conf.d/ which contains the http string for the proxy. The line looks like this:

Acquire::http::proxy "http://domain\username:password@proxyip:8080/";

Where domain is our domain, username is my username, password is my password (which contains non-alphanumeric characters) and proxy IP which is the ip address of our proxy. As a result, apt-get update / install / upgrade all work fine. I am now trying to get general internet access working. To do this I have tried each of the following:

export http_proxy=http://domain\username:password@proxyip:8080/
export HTTP_PROXY=http://domain\username:password@proxyip:8080/
export http_proxy=http://domain%5Cusername:urlencodedpassword@proxyip:8080/
export HTTP_PROXY=http://domain%5Cusername:urlencodedpassword@proxyip:8080/
export http_proxy=http://username:password@proxyip:8080/
export HTTP_PROXY=http://username:password@proxyip:8080/
export http_proxy=http://username:urlencodedpassword@proxyip:8080/
export HTTP_PROXY=http://username:urlencodedpassword@proxyip:8080/

As well as each of the above surrounded by quotes (") but I still cannot get a simple wget to work.

Any ideas?

  • 1
    Did you try export http_proxy=http://domain\\username:password@proxyip:8080/ ?
    – wurtel
    Feb 10, 2015 at 9:14
  • I have just tried this (had to url encode my password) still nothing with wget Feb 10, 2015 at 9:44
  • Could you share the output of Wget. Why exactly does it not work? What is the error? It would be even better if you can share the output with the --debug option when running Wget
    – darnir
    Feb 10, 2015 at 10:29

2 Answers 2


Old question but maybe useful for someone looking for a similar problem.

The user didn't explain in his question if he's executing sudo or he's using the root account.

I've experienced something similar, wget was working but apt-get wasn't, of course I was behind a corporate firewall.

The thing is, we must export the proxy variables for the user executing the command, in my case it was:

export http_proxy=http://stupid_corporate_proxy:8280
export https_proxy=http://stupid_corporate_proxy:8280

mortiz@florida: wget http://us.archive.ubuntu.com
Proxy Request sent awaiting response .... 200 OK

# And when executing apt-get, it fails

mortiz@florida: sudo apt-get update 
couldn't resolve us.archive.ubuntu.com

This has sense, because for root (sudo) I didn't export the proxy variables, so the user hadn't the proxy. I logged as root, exported the proxy variables and then apt-get worked.

Other problem could be if there are special characters in the password of the user:

export http_proxy=http://domain\username:MyP$ssW0rd@proxyip:8080/

We could try escaping special characters:

export http_proxy=http://domain\username:MyP\$ssW0rd@proxyip:8080/

I hope this might be useful for someone looking for answers.


I suspect that TMG server does not support Basic authentication method, and wget doesn't offer anything else: (source code).

So you're out of luck.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .