Skip to main content
xenoveritas.org

Main navigation

  • Categories
  • Home
  • Links
  • Name Generator
  • Scramble
User account menu
  • Log in

Breadcrumb

  1. Home

Upgrading to Ubuntu 10.04 Behind a Proxy

By Xenoveritas, 7 April, 2010
Topics
Linux

J.D. (not verified)

15 years ago

Thanks!

Hi!

Thanks, your post saved my day :)

  • Reply

Arthur Dent (not verified)

14 years 11 months ago

In reply to Thanks! by J.D. (not verified)

Thanks

Hey thank you very much!

  • Reply

Marco (not verified)

14 years 11 months ago

Thank you very much!

You're a hero !

  • Reply
  • Add new comment

If you do a update-manager -d under Ubuntu 9.10 and happen to be behind a firewall, you might notice that it appears to freeze as soon as you click on the Upgrade button. This is caused by a known bug in Ubuntu where the start of the upgrade process doesn't take your proxy settings into account.

It's been fixed in 10.04, but that doesn't help you if you're using 9.10 or 9.04.

So how do you fix it?

Well, you're going to need to edit /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py. You'll need to do that as root, so open a Terminal and "sudo nano /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py."

Press Ctrl-W and then Ctrl-T and type in "104" to jump to the problem lines:

      c = httplib.HTTPConnection(netloc)
      c.request("HEAD", path)

Change those lines to read:

      c = httplib.HTTPConnection("your.proxy.host:80")
      c.request("HEAD", scheme + netloc + path)

Where your.proxy.host:80 is the proxy host name followed by its port number. Press Ctrl-O and then press Enter to save, then Ctrl-X to exit.

You should now be able to click Upgrade and everything should go smoothly.

If you want the actual patch used (in case you don't know your proxy settings, I guess), go to line 103 and insert the following before it:

    proxy = os.getenv("http_proxy")
    if (proxy):
      path = scheme + netloc + path
      netloc = proxy

The new version should read something like:

  if scheme == "http":
    import httplib
    proxy = os.getenv("http_proxy")
    if (proxy):
      path = scheme + netloc + path
      netloc = proxy
    try:
      c = httplib.HTTPConnection(netloc)
      c.request("HEAD", path)

Since this is Python, whitespace counts.

Current Games

I'm currently playing:

  • Final Fantasy XIV: Endwalker

I intend to maybe get around to finishing:

  • Literally anything else

Video Games Section

Thought for the Moment

I never have thoughts any more.

Old Thoughts

Has the LHC Destroyed the Earth?

  • Create new account
  • Reset your password
RSS feed
Powered by Drupal