Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In my workplace we use the Pac file for proxy network .And the Pac file when i give to the browser setting its work fine Edit-->Advance-->Network-->Setting. When i gave the Url its working fine for me.

But for apt-get i was not able to update.

I added the same URL in the network proxy for that. My pac file have no username or password.

Please suggest me .How should the apt-get work in my new ubuntu 11.10.I am really struggling a lot to fix this issue

share|improve this question

1 Answer 1

I do not know if APT is able to use a PAC file directly but you can (with quite a bit of work/understanding) extract the relevant proxy information from the PAC file itself and use this information to configure APT to use a HTTP proxy.

The PAC file essentially consists of a JavaScript function. The return statement (one or more) of the function returns the proxy server address and port, for example:

return "PROXY proxy.some.site:8080; DIRECT";

Just look at your PAC file by entering its address in a browser. With this information you can create an APT configuration file:

sudo gedit /etc/apt/apt.conf.d/proxy

You should modify the file so that it contains the following information:

Acquire::http::Proxy "http://proxy.some.site:8080";

Save the file and the next apt-get run should use the configured proxy setting.

It would be nice if APT could work with PAC files because we also use them in our company. Perhaps somebody else knows if/how it works...

The Ubuntu Wiki Page for AptGet also has some hints how to configure a proxy for APT.

See also http://superuser.com/questions/323488/ubuntu-system-wide-proxy-auto-configuration-pac-script

share|improve this answer
2  
FWIW - I had issues getting apt to work behind our MS ISA proxy. I'd tried the bash.rc method; didn't work. But creating the /etc/apt/apt.conf.d/proxy file and adding an entry in the format Acquire::http::Proxy "domain\username:password@proxy_name:8080"; did the trick. –  Chris Feb 21 '12 at 14:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.