It is a corporate network with proxy. The proxy URL is a proxy file... The only way to use apt install or apt updatE on my fresh desktop Ubuntu 18 LTS (installed by pendrive without internet) is using a client-proxy defined by the following PAC file at its address http://pac._proxyDomain_/proxy.pac:

myip = myIpAddress();

function FindProxyForURL(url, host)
        if (isPlainHostName(host))
        return "DIRECT";

         // Bypass Local Network
     if (isInNet(dnsResolve(host), "", "")
        || isInNet(dnsResolve(host), "etc", "etc")
        || ...
         || isInNet(dnsResolve(host), "etc", "etc"))
         return "DIRECT";

         // Bypass Local IP
     if ( isInNet(dnsResolve(host), "etc", "etc")
         || isInNet(dnsResolve(host), "etc", "etc")
         || isInNet(dnsResolve(host), "etc", "etc"))
         return "DIRECT";

         // Bypass URL
     if ((host == "domain1")  
         || (host == "domain2")
        || (host == "etc")
         || (host == "etc"))
         return "DIRECT";

         // Bypass Domain
     if (shExpMatch(url, "*.domain")
      || shExpMatch(url, "*.etc")
      || shExpMatch(url, "*.etc"))
         return "DIRECT";

         //Encaminha todo o trafego que restante para o PROXY CORPORATIVO
         return "PROXY _IP_:8080; DIRECT";

How to install and use UBUNTU with PAC proxy?

When using install wizard there are no option to upload PAC file.

Note: supposing that "PAC file" is "Proxy Auto-Configuration"... And in the past there are no direct solution but in nowadays (2019!) there are solutions... A summary of the question is "where is the modern solution?".

Notes for alternative solutions:

If there are no Linux solution (!!??) for automatic use of PAC file, an solution is to reconnect computer by different proxy options (no proxy or with proxy in the same network connection), so a easy way to:

  1. configure the proxy for use with terminal (to run apt update, wget, etc.)
  2. configure the proxy for browser
  3. avoiod "cached proxy" conflict and other problems when use more tham one connection.

Links checked for clues:

  • Peter, I got your help request from a comment in another question. Unfortunately all of this is over my head. Sorry I can't help. – heynnema Jul 29 '19 at 21:03
  • Thanks @heynnema. Well, yor comment is also an information: seems that we can discard Wireshark as tool/solution for this problem. – Peter Krauss Jul 29 '19 at 21:26

You don't need a PAC file. The purpose of the PAC is to have different proxy configurations for different hostnames/domains. Assuming your installing over the internet, use the actual proxy server that you need to use. In the case of this PAC file, _IP_:8080

  • Thanks (!), good clues, near solution: there are many options, how to run the BIG PAC javascript and obtain the answer for "my proxy is...??" – Peter Krauss Jul 29 '19 at 18:11
  • I am trying this clue, that seems a script that runs in any browser with the PAC file script – Peter Krauss Jul 29 '19 at 18:37
  • It's been a while since i have dealt with these, but I thought you could download the automatic proxy config just by browsing to proxy, though that could have been the network I was on. There is always Wireshark if you have full access to that network. – rtaft Jul 29 '19 at 19:41
  • Hi @rtaft, even Wireshark "is a network analysis tool and packet analyzer" (ref), so it is also not a solution for my problem: I need plug-and-play Internet access... There exist a solution? How to configure internal Linux http_proxy exporters and passwords? I need simple plug-and-play Internet for all my machine, from browser to terminal apt update. – Peter Krauss Jul 29 '19 at 19:56
  • Do you have a copy of the actual pac file? – rtaft Jul 30 '19 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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