software center/software updater/apt-get doesn't use proxy authentication info and gets no internet access

Bug #651229 reported by Ralf on 2010-09-29
This bug affects 13 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
software-center (Ubuntu)
update-manager (Ubuntu)

Bug Description

System has internet access via a proxy server with authentication.
All info is set in "System/Preferences/Network Proxy" and applied system wide.
Update manager reports a "407" when trying to download.
Firefox hasn't any problems using the system defaults.
As we all know, synaptic has got its own proxy preferences. That works and this is the only way for updating the system.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: update-manager 1:0.142.15
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Wed Sep 29 17:10:53 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100803.1)
PackageArchitecture: all
SourcePackage: update-manager

See also bug 897686.

Ralf (rkeunecke) wrote :
juliobahar (yahalla-julio) wrote :

I can confirm this bug on ubuntu 10.10 i368
update-manager: version 0.142.19
Linux ubuntu 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux

Synaptic can access updates, yet update-manager produces an error.

Aghast (svarte) wrote :

Same for me. As a workaround change /etc/apt/apt.conf like
Acquire::http::proxy "http://user:password@hostname:port/";

Puffy (grant-gordon) wrote :

I'm having the same problem after upgrading from 10.04 to 10.10. I've made the changes manually in my apt.conf file (It seems to take the proxy settings from the "System/Preferences/Network Proxy" when you apply it globally, but it doesn't set the authentication details?) However, this doesn't fix the problem. I can now run 'apt-get update' but clicking "check" in the update-manager still results in the 407 error.

JayJay (jukka-jalava) wrote :

Thank you Aghast for the workaround!

I had the same problem with Update Manager but also noticed that:
- I had the system wide proxy set
- on a shell this resulted in variables all_proxy, ftp_proxy, http_proxy, https_proxy and no_proxy being set and exported
- the values are passed to sudo, i.e.:
    $ sudo echo $http_proxy
  returns the correct setting
- BUT when I try to:
    $ sudo apt-get update
  connecting to servers fails!
- HOWEVER if I choose to:
    $ sudo su
    # apt-get update
  it works!!?

With Aghast's workaround '$ sudo apt-get update' is working OK as well as the Update Manager.

Henning Moll (drscott) wrote :

init_proxy is correctly retrieving the proxy configuration (host, port and user/password if any) and also sets up the proxy for use by urlib2. It also exports the information to the environment (os.putenv("http_proxy",proxy)).

Now it comes to /usr/lib/apt/methods/http. This tool is successfully called by Core/MyCache.requiredDownload(). It seems that the exported environment setting is used. Note, that the tool is called diretly this time.

Later on, /usr/lib/apt/methods/http is used indirectly via "aptd". The problem is, that the process of aptd does not have http_proxy in its environment.

i can confim that setting proxy information in /etc/apt/apt.conf resolve the (later) problem. But Ubuntu should be usable without editing conf files. Either gnome-network-properties should also modify /etc/apt/apt.conf (system wide) or update-manager needs to 'tell' aptd the missing info.

btw: the comment for function init_proxy suggests that it would "first check for http_proxy environment (always wins)". But it doesn't or do i miss something?

giovani carelli (gcarelli) wrote :

The apt.conf solution works, but only if you kill "/usr/bin/python /usr/sbin/aptd" previously.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in update-manager (Ubuntu):
status: New → Confirmed

Why update-manager does not use system proxy settings?

description: updated
Adam Niedling (krychek) wrote :

This is still a problem in Ubuntu 13.10. It just keeps trying to connect without success and there is no error message that it can't connect.
 And when I press stop it's telling me that "The software on this computer is up to date". Why is it saying that? It can't know it because it couldn't check it.

Adam Niedling (krychek) on 2013-07-08
summary: - update manager doesn't use proxy authentication info and gets no
- internet access
+ software center/software updater/apt-get doesn't use proxy
+ authentication info and gets no internet access
Adam Niedling (krychek) wrote :

After further testing this issue only occurs when Proxy Method is Automatic (pac file). Apt-get and Software Updater works fine with Manual Proxy Method. (Can't test Software Center now because it won't start after the latest update.)

Julian Andres Klode (juliank) wrote :

APT does not support proxy auto-configuration, and never will, as this requires a JavaScript engine, which is not a good idea to run as root and depend on in a package with Priority: important.

But you should be able to write your own implementation by writing a script and set Acquire::http::ProxyAutoDetect to it. See squid-deb-proxy for an example script.

Changed in apt (Ubuntu):
status: New → Opinion
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-center (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers