5

I have a system about 3000km away, so I have no access to it. The machine is running ubuntu 13.04 (yes, it's EOL passed long ago), and the python module is completely messed up. when I tried to use do-release-upgrade to upgrade it to 13.10 and then 14.04 (as explained here) I got this error message:

Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 8, in <module>
    from DistUpgrade.DistUpgradeVersion import VERSION
ImportError: No module named DistUpgrade.DistUpgradeVersion

Even UFW stopped working. it showed this error:

Traceback (most recent call last):
  File "/usr/sbin/ufw", line 26, in <module>
    import ufw.frontend
ImportError: No module named ufw.frontend

So I thought I can re-install python, and life is good. Trying to reinstall python did not work at all so I thought maybe I can uninstall python and reinstall it, which also turned out to be a very stupid move! now my python package is reported as purge, trying to do anything with dpkg or apt-get throws a million errors and then exits, and almost none of the tools work!

I dont mind upgrading or installing a fresh copy of ubuntu (which I think I have to do anyway) but I cant find any clue how I can do this over the network? Is it even possible?

Edit 1:

For example when I try to run sudo dpkg --configure -a to fix the problems of the installer, I get an output like this:

dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-gtk:
 ubuntu-release-upgrader-gtk depends on update-manager; however:
  Package update-manager is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-distupgrade (= 1:0.192.13); however:
  Package python3-distupgrade is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-dbus; however:
  Package python3-dbus is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing ubuntu-release-upgrader-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport-gtk:
 apport-gtk depends on python3-apport (>= 2.9.2-0ubuntu8.5); however:
  Package python3-apport is not configured yet.
 apport-gtk depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing apport-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-debian:
 python3-debian depends on python3-chardet; however:
  Package python3-chardet is not configured yet.
 python3-debian depends on python3-six; however:
  Package python3-six is not configured yet.

dpkg: error processing python3-debian (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-manager-core:
 update-manager-core depends on python3-update-manager (= 1:0.186.2); however:
  Package python3-update-manager is not configured yet.

dpkg: error processing update-manager-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-manager-gnome | update-manager (>= 1:0.165); however:
  Package update-manager-gnome is not installed.
  Package update-manager is not configured yet.
 update-notifier depends on ubuntu-release-upgrader-gtk; however:
  Package ubuntu-release-upgrader-gtk is not configured yet.

dpkg: error processing update-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-core:
 ubuntu-release-upgrader-core depends on python3-distupgrade (= 1:0.192.13); however:
  Package python3-distupgrade is not configured yet.

dpkg: error processing ubuntu-release-upgrader-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of aptdaemon:
 aptdaemon depends on python3-aptdaemon (= 1.0-0ubuntu9); however:
  Package python3-aptdaemon is not configured yet.
 aptdaemon depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing aptdaemon (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-gi-cairo:
 python3-gi-cairo depends on python3-gi (= 3.8.0-2); however:
  Package python3-gi is not configured yet.
 python3-gi-cairo depends on python3-cairo (>= 1.10.0+dfsg-3~exp2); however:
  Package python3-cairo is not configured yet.

dpkg: error processing python3-gi-cairo (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of friends:
 friends depends on friends-dispatcher; however:
  Package friends-dispatcher is not configured yet.

dpkg: error processing friends (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport:
 apport depends on python3-apport (>= 2.9.2-0ubuntu8.5); however:
  Package python3-apport is not configured yet.
 apport depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing apport (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ubuntu-release-upgrader-gtk
 apport-gtk
 python3-debian
 update-manager-core
 update-notifier
 ubuntu-release-upgrader-core
 aptdaemon
 python3-gi-cairo
 friends
 apport

Or trying to run sudo apt-get install -f outputs a lot of error and stops like this:

dpkg: error processing friends-twitter (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-aptdaemon.pkcompat:
 python3-aptdaemon.pkcompat depends on python3-aptdaemon (= 1.0-0ubuntu9); however:
  Package python3-aptdaemon is not configured yet.

dpkg: error processing python3-aptdaemon.pkcompat (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: too many errors, stopping
Errors were encountered while processing:
 python3-dbus
 language-selector-common
 python3-gi
 python3-xkit
 ubuntu-drivers-common
 python3-commandnotfound
 ufw
 apparmor-utils
 python3-problem-report
 python3-apport
 apport
 apport-gtk
 python3-software-properties
 software-properties-common
 python3-defer

Thanks

  • 2
    Close voters: Yes EOL releases are off-topic per our policy, but this is mostly about upgrading, which we do support. Mohammad: Can you please show us some of the apt errors? Do you have any PPAs installed? How did you mess Python up so bad? – Seth Dec 25 '14 at 1:05
  • 1
    Thanks Seth, python got all messed up because I am quite new to python and had the idea that its just another compiler (or interpreter) like g++ or many other packages installed in Ubuntu, it can be simply removed and re-installed, so when it got messed up and could not run do-release-upgrade, I tried to remove the whole thing and re-install it (I used --auto-remove) when I noticed it started to uninstall half of the system packages along side with it. I updated the question to include the detail dpkg/apt-get errors I get. – Mohammad Hashemian Dec 25 '14 at 3:29
  • 1
    Yes, a lot of the system relies on python, since it is written in python. Not really a good idea to remove it ;) It really looks like you're stuck, but I'll admit apt errors aren't my forte. – Seth Dec 25 '14 at 3:38
  • yeah I already learnt that, though the hard way! :( – Mohammad Hashemian Dec 25 '14 at 3:45
  • 2
    You could try to download the original deb packages from: archive.ubuntu.com/ubuntu/pool, but you have to know the exact version you require. – Gx1sptDTDa Dec 25 '14 at 21:50
2

Well, I ended up creating an AWS instance based on Ubuntu 13.04, and then move all python packages over from EC2 to my server. This did not fix the problem with apt-get and dpkg, but it let me run other python-based commands (e.g. ufw and do-release-upgrade).

Then I used do-release-upgrade to switch to Saucy and then Trusty. There were some errors during upgrade, but overall it updated to 14.04 successfully.

After update was done, I ran apt-get install -f and dpkg --configure -a again, and this time got a lot less errors, though still failed. I fixed errors one by one, again by borrowing the broken packages from another server running 14.04.

At the end it migrated to 14.04 and all package issues were fixed as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.