Friday, 4 May 2012

HOWTO: Upgrade from Lucid to Precise

UPDATED 12/06/2012. I have had reason to attempt this on two more systems and both times  it was successful.

The Ubuntu distribution continues its rapid decline with the Precise release.

The Internet is teeming with examples of people who have discovered that upgrading to Precise is difficult at best, and near impossible at worst.

It doesn't appear that upgrading from the last LTS, 10.04 Lucid is possible at all.

Well, not easily anyway.

Attempting to upgrade a server from Lucid to Precise will most likely result in an error;

E: Could not perform immediate configuration on 'python-minimal'.Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

Searching the Internet might lead you to a suggested fix such as this one;

sudo apt-get install -o APT::Immediate-Configure=false -f python-minimal

Apparently, sometimes that doesn't work either, forum post suggests adding apt to that command;

sudo apt-get install -o APT::Immediate-Configure=false -f python-minimal apt

Having got that far, I received another error;

E: Couldn't configure pre-depend multiarch-support for libnih-dbus1, probably a dependency cycle

Joy.

No help was forthcoming from the Internet on that one.

So, I tried a desperate move.

I decided to remove the offending file (libnih-dbus1) and re-install it.

Now, before I continue, I should make it absolutely clear that what follows is capital N Nasty.

The server I was working on was a scratch virtual machine that I would not care about if I accidentally toasted it.

It is entirely possible that doing this on your server may completely trash it!

You have been warned.

OK, with that out of the way, what I did was this;

apt-get remove libnih-dbus1

Apt went away and calculated a whole lot of dependencies that would be removed which resulted in it giving me a nasty warning;

You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'


Undaunted, I copy-pasted the list of files being removed into a text editor (just in case) and typed the "Yes, do as I say!" phrase as requested;

After a while apt was finished.

Note: If you are following this "procedure", do not reboot your system now!

OK, I was afraid my SSH session or network (or something) may have been broken causing me to lose my connection (yes, I was doing this remotely) but the server still seemed to be working, which was good.

So I installed everything back.

apt-get install ubuntu-minimal

This returned no errors.


Now, when we did the nasty remove of libnih-dbus1 and its dependents earlier, one of the things that was removed was the Linux kernel.

Without being to dramatic, it is fair to say that this is an extremely important package. Another important thing that was removed was openssh-server

Install them now;

apt-get install linux-image-server openssh-server


The final thing to do is to reboot and to make sure everything is truly OK

The server rebooted without problems and finally I have managed to upgrade from Lucid to Precise.

Yay, I suppose, but it really shouldn't be that hard.


Canonical should spend less time working on horrible user interfaces and more time getting the basics right.

A final note: Check your list of files that were removed to check whether anything else that may have been installed was removed. You should manually re-install anything you need.

4 comments:

Anonymous said...

Thank you for howto, running fine for me. just before reboot I type 'sudo apt-get dist-upgrade'.
Greetings.

Tytus Kurek said...

Thank you very much for your post. Very helpful!

Anonymous said...

NEVER seen such a nasty Dist-Upgrade...
Umm I got "-bash: /usr/bin/apt-get: No such file or directory" :( I'll retry with a backup

3rdbit said...

BTW the bug of the python package should be fixed now, but it doesn't seem to be.

https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/983981