update-manager doesn't honor apt.conf Proxy setting

Bug #361554 reported by Paolo Benvenuto on 2009-04-15
This bug affects 7 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Michael Vogt

Bug Description

Binary package hint: update-manager

I'm using apt with apt-cache because I have various pc with the same ubuntu, and I want to save bandwidth.

My apt.conf has only one line:

Acquire::http::Proxy "http://paolo:3142/";

it teaches apt to use the apt-cacher in paolo:

However, when I run update-manager -d to upgrade to jaunty beta, it appears that packages are being downloaded from web servers, not from apt-cacher proxy.

I think update-manager should honour apt.conf settings.

Michael Vogt (mvo) wrote :

Thanks for your bugreport.

update-manager should honor apt.conf. Could you please check if it was just some bits that got downloaded without the proxy or if it was all packages. The logs in /var/log/dist-upgrade/ and the apt-cacher logs should help diagnoising this.

Changed in update-manager (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
status: New → Incomplete
Paolo Benvenuto (donpaolo) wrote :
Changed in update-manager (Ubuntu):
status: Incomplete → New
JohnCollaros (timefantom) wrote :

I am trying to do a release upgrade to karmic from jaunty and have noticed it does not honor proxy settings.
Currently, regular upgrades work, but the dist-upgrade is failing.
I am running from a non-privileged user prompt

  sudo update-manager -d

In another terminal i have a tcpdump running.
When update-manager launches I can see it connecting to my apt-cacher on port 3142.
But when I click the new distribution upgrade button, I can see it making direct requests to the internet, bypassing the proxy server.
I have proxy unset in the environment variables, but set in apt.conf, in synaptics, and in gnome all to the same thing. (my apt-cacher)
Even when I use the http_proxy= environment variable I get the same result.

It seems update-manager's dist-upgrade process ignores any proxy setting.

Is anyone else having this problem?

Matthias Sommer (sunny0815) wrote :

Exactly the same here, normal updates work, "update-manager -d" starts but hangs if I click the upgrade button.

Matthias Sommer (sunny0815) wrote :

Workaround: manually edit /etc/apt/sources.list and replace all occurances of "jaunty" with "karmic" and launch update-manager (without -d). This works, only does not give you the message box telling stuff about the new release. It simply offers a distribution upgrade and if allowed to do, executes this just fine.

Rob Fisher (robfisher) wrote :

The bug is in /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py . The url_downloadable function does not try to use the proxy.

The offending code is:
import urlparse
(scheme, netloc, path, querry, fragment) = urlparse.urlsplit(uri)
c = httplib.HTTPConnection(netloc)
c.request("HEAD", path)

It should connect to the proxy, not to the netloc part of the uri.

I used this workaround:

import urlparse
(scheme, netloc, path, querry, fragment) = urlparse.urlsplit(uri) # we still need scheme for later
proxy = os.getenv('http_proxy') # this has already been set by init_proxy
c = httplib.HTTPConnection(proxy) # connect to the proxy instead
c.request("HEAD", uri) # specify the whole URI here

It's a bit of a hack and won't work for ftp uris. I've never submitted an Ubuntu patch before so will have to learn how to do that before fixing it properly, unless someone else is inclined to.

Michael Vogt (mvo) wrote :

Thanks Rob for your patch.

A similar patch is now uploaded to jaunty-proposed so getting the update-manager from there should fix the issue (see bug #446552).

Changed in update-manager (Ubuntu):
status: New → Fix Committed
Michael Vogt (mvo) on 2011-02-16
Changed in update-manager (Ubuntu):
status: Fix Committed → Fix Released
Vincenzoml (vincenzoml) wrote :

This bug is present in natty and as a result I can not upgrade to oneric. I do not know how it comes it was fixed in jaunty. I do not seem allowed to reopen, please do so in my place.

Vincenzoml (vincenzoml) wrote :

The problem is proxy authentication which is not exported from the gnome proxy settings to the apt.conf file.

Changed in update-manager (Ubuntu):
status: Fix Released → New
Launchpad Janitor (janitor) wrote :

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

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

Duplicates of this bug

Other bug subscribers

Bug attachments