Problems updating your Ubuntu installation. Read on.(from http://serverfault.com/questions/8540/recover-from-shutdown-during-ubuntu-distribution-upgrade, viewed June 2011)
I have a computer which was unexpectedly shut down during a distribution upgrade (Ubuntu 8.10 -> 9.04). It now won't finish booting - various X errors, then it goes to the login screen but won't allow logins. I have a backup of it and the /home data is all still OK on the drive so it's no emergency, but a complete rebuild is still an annoying and time consuming process.
The upgrade was recovered using something like this:
sudo dpkg --configure -a sudo apt-get update sudo dpkg --configure -a sudo dpkg --configure -a --abort-after=99999 sudo apt-get dist-upgrade sudo apt-get -f install sudo apt-get dist-upgrade