Upgrading Ubuntu from Jaunty to Karmic Behind a Proxy
Note: While this will update all of one’s packages to the latest release, as pointed out by Marcos in the comments, this method makes you miss out on all added/removed packages, among a few other things. So this is probably not the way anyone really wants to go!
This should be a quickie…
While my distro of choice is Gentoo, I use Ubuntu at work ever since I was told any compiling of packages would be on my own time.
In any case, since version 9.10 (Karmic Koala) came out last week, I figured I’d give it a shot. Well, since I’m in a business environment behind a proxy, it wasn’t so straightforward, and the built-in “Update Manager” utility just hung forever, trying to make a connection. I was only able to figure out exactly what the problem was by strace on it, and sitting on one call. Anyway, onto the fix!
Seems simple, because it is. Just open up your /etc/apt/sources.list, and change all instances of “jaunty” to “karmic”, or use a little sed-fu:
# sed -i 's/jaunty/karmic/' /etc/apt/sources.list
Then run your usual apt-get update/upgrade.
I don’t think this is a recommended way of upgrading, but since the update program was broken and the CD didn’t work for me (froze when clicking any of the menu options) I didn’t have much choice. In any case, I’ve been using my system all day now with no issues, so this method worked out for me.





Upgrading like that will upgrade all packages you have installed to their newest versions. And it may install and remove others packages. But you won’t get the same system if you do a fresh install. For example: rsyslog replace sysklog, upstart replace init, ext4 replace ext3, grub2 replace grub.
The recommended/supported upgrade method is pretty simple:
$ sudo apt-get install update-manager-core # probably already installed
$ sudo do-release-upgrade
If your system was non-standard enough for that to fail, I’m surprised that your way worked… but good for you anyways.
@Marcos: You’re right, I didn’t think about that. Clearly I’m too used to Gentoo, where a simple package update will always suffice!
@ephemient: I did come across that and try it, to no avail. It just said I was up to date. As for “non-standard”, I’m pretty sure my box had no strange configs and in the vicinity of 1 non-standard package installed. So while I didn’t mention it above, I didn’t jump off the deep end *right* away.
do-release-upgrade takes options -d (upgrade to development release) and -p (upgrade to proposed release). Configuration in /etc/update-manager/release-upgrades can override what releases update-manager considers permissible as upgrade candidates.
Hi,
Thanks for this. Not one article in the Ubuntu forums mentioned problems when upgrading behind a proxy server.
Thanks,
Wenbert
My laptop:
Authenticating proxy (workplace 1) = shows upgrade, but hangs when told to install.
Transparent proxy (workplace 2) = Goes fine. Not one error.
Workplace 1 desktop = Fail. Does not even show up an upgrade. Tried command line and GUI. Not happy as I specifically sat down 20 minutes ago with the intention of doing this today.
Canonical is going to lose a lot of Ubuntu users if they don’t drop the stupidity and arrogance. They are becoming as bad as Microsoft and Apple.
@Tim B
Good to point out: mine was an authenticating proxy. Didn’t think about that being a factor. Not that I really had a choice about it.
I had the same problem, with a bit of investigating it appears that the python file /usr/share/pyshared/DistUpgrade/utils.py is the cause of the problem. There is a function called init_proxy() which clears out the environment proxy and replaces it with whatever it finds in apt.conf/synaptic/gconf.
My problem was that I had set a proxy in apt.conf a long time ago which was not wrong, clearing this out solved my problem.
Might be worth a try checking those files or adding Acquire::http::Proxy “http:///”;
to your /etc/apt/apt.conf file.
@Adam C
Good catch! Though I’m still not sure why a correct proxy value in that file (mine is there, though I never manually put it there) would cause failure. In any case, I’ll certainly revisit your advice come the next upgrade if it’s still an issue!
I’ve just tried upgrading to Lucid from Jaunty behind a proxy and experienced the same problem.
The problem is not authenticating vs non-authenticating proxy. It happens with any explicit proxy – any situation where you have to specify a proxy address in order for any HTTP to work.
The problem stems from the function url_downloadable() in /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py. It looks like this function is called during the process of deciding which mirror to use. The intent of this function is simply to check whether a given URL works and I think it is used here to check whether a given mirror is up and available and serving the right files.
Unfortunately something in the way this function invokes the http library means that the proxy settings are ignored. The library tries to make a direct connection to the site serving the url in question. You can see this by running ‘netstat -at’ while the update process is hung – you will see a connection to a canonical.com host in the SYN_SENT state.
I don’t have the inclination at this stage to work out how to re-plumb all this so the url_downloadable() check does respect proxy settings. However, I did use the following hack to make the installation work:
$ sudo vi /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py
Search for the ‘url_downloadable’ function def. Now look for the following lines of code within that function and add ‘return True;’ as shown:
if scheme == “http”:
import httplib
try:
return True;
c = httplib.HTTPConnection(netloc)
c.request(“HEAD”, path)
This basically bypasses the ‘url_downloadable’ check and forces the upgrade process to assume it’s succeeded. When the upgrade process comes to actually download and install stuff, it uses the proxy settings correctly.
This is clearly a bug in the Upgrade process.
@Richard Baldry Thanks for the hack! I managed to successfully upgrade that way. It’s annoying that there seems to be a proxy bug of some sort in every release.
@Richard Baldry
Thanks for the hack!
Ah Richard, you’re the problem-solver I can’t muster in myself in the morning.
Richard’s hack works wonders – upgrading to 10.04 on my laptop at work now, although I did have to slightly modify the hack. Had to match the indent of the lines below and leave off the semi-colon.
Also, remember to add the proxy username and password to apt.conf if you need one! I forgot the first time, and was left wondering why it was still failing (though not hanging at least).
@Richard Baldry
.
Dude! Thanks a lot. Works like a charm. Had I known this fix, would have been able to save atleast a couple of hours trying to search for a solution. Anyway, better late than never