Based on my past experience, overall Ubuntu (GNOME) doesn't work very well with PAC (Automatic Config). Pac (Proxy Auto-config) is basically JavaScript logic to determine the closest or most appropriate proxy for you, I strongly recommend using the proxy servers directly (in your case Network - Network Proxy).
A few things to check
Check your /etc/apt/apt.conf
Network -Network Proxy GUI will update /etc/apt/apt.conf
and set the proxy info there.
Find out the proxy server info from pac
You can find the details by reading the proxy.pac
file anyway.
So the /etc/apt/apt.conf
should look like below (suppose the proxy server is => proxy.company.com port 80), do NOT use pac URL.
Acquire::http::proxy "http://proxy.company.com:80/";
Acquire::https::proxy "https://proxy.company.com:80/";
Acquire::ftp::proxy "ftp://proxy.company.com:80/";
NOTE: If no proxy is specified in the apt config files, apt-get
will fall back to http_proxy
environment variable.
From apt.conf man page, respond to the comment from @Braiam
http
HTTP URIs; http::Proxy is the default http proxy to use. It is in
the standard form of http://[[user][:pass]@]host[:port]/. Per host
proxies can also be specified by using the form http::Proxy::<host>
with the special keyword DIRECT meaning to use no proxies. If no
one of the above settings is specified, http_proxy environment
variable will be used.
Check proxy environment variables
You can check proxy settings by running the following in terminal
echo $http_proxy
echo $https_proxy
echo $ftp_proxy
If you set env variables correctly, you should be should be able to update in CLI.
Prefer IPv4
I noticed apt-get
was trying to connect to the update servers using their ipv6 address. This could cause problems (sometimes the IPV6 addresses expire or change).
You can edit /etc/gai.conf
and add precedence ::ffff:0:0/96 100
to prefer ipv4 over ipv6.
More details
Those are examples. Use only the ones you need to. I only use the Debian and Ubuntu configuration lines. From the manual, the syntax for the Remap
directive:
Remap-RepositoryName: MergingURLs ; TargetURLs ; OptionalFlags
The MergingURLs
are set of mirrors which are considered equivalent. I think this lets you mix and match mirror URLs in the client sources.list
, but downloads usually will only take place from the URLs specified in TargetURLs
. The lists of mirrors are provided with the package, and should be in the /usr/lib/apt-cacher-ng
directory.
The backends_*
files are provided with package as well, presumably because this package is for Debian and Ubuntu, and people using it are likely going to use it for Debian and Ubuntu. The point of creating empty backend files eludes me, as does the reason behind the lack of complaints about the other files.
Best Answer
To use a proxy, you need a proxy server. The IP and port have to be from this proxy server. Login and pwd must be your user and password on the proxy server (if the proxy requires login).
From help.ubuntu.com site:
If your proxy needs a login/password, substitute:
with:
using username and password from the proxy server.