Dapper->hardy upgrade failed during do-release-upgrade (apparently a python-apt issue)

Bug #194448 reported by Michael R. Head
4
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Undecided
Unassigned
python-central (Ubuntu)
Fix Released
Undecided
Unassigned
update-manager (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: update-manager

Quote:
ldconfig deferred processing now taking place
Errors were encountered while processing:
 update-manager-core

Could not install the upgrades
The upgrade aborts now. Your system could be in an unusable state. A recovery will run now (dpkg --configure -a).

Please report this bug against the 'update-manager' package and include the files in /var/log/dist-upgrade/ in the bugreport.
installArchives() failed
dpkg: dependency problems prevent configuration of update-manager-core:
 update-manager-core depends on python-apt (>= 0.7.4ubuntu5); however:
  Version of python-apt on system is 0.6.16.2ubuntu8.1.
dpkg: error processing update-manager-core (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 update-manager-core

Revision history for this message
Michael R. Head (burner) wrote :
Revision history for this message
Michael R. Head (burner) wrote :

In addition to the tarball, I'm uploading the individual components of /var/log/dist-upgrade

Revision history for this message
Michael R. Head (burner) wrote :
Revision history for this message
Michael R. Head (burner) wrote :
Revision history for this message
Michael R. Head (burner) wrote :
Revision history for this message
Michael R. Head (burner) wrote :

term.log was empty

Revision history for this message
Michael R. Head (burner) wrote :

(BTW, this was an ubuntu-server upgrade using do-release-upgrade, as described on https://help.ubuntu.com/community/HardyUpgrades)

Revision history for this message
Michael R. Head (burner) wrote :

And yeah, I'm having trouble getting past this:

burner@firewall:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
  python-apt
Suggested packages:
  python-apt-dbg
The following packages will be upgraded:
  python-apt
1 upgraded, 0 newly installed, 0 to remove and 232 not upgraded.
1 not fully installed or removed.
Need to get 0B/194kB of archives.
After this operation, 1614kB of additional disk space will be used.
Do you want to continue [Y/n]?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en",
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 28105 files and directories currently installed.)
Preparing to replace python-apt 0.6.16.2ubuntu8.1 (using .../python-apt_0.7.4ubuntu6_i386.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 1594, in <module>
    main()
  File "/usr/bin/pycentral", line 1588, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 1082, in run
    old_pkg.read_version_info()
  File "/usr/bin/pycentral", line 602, in read_version_info
    raise PyCentralError, "package has no field Python-Version"
__main__.PyCentralError: package has no field Python-Version
dpkg: error processing /var/cache/apt/archives/python-apt_0.7.4ubuntu6_i386.deb (--unpack):
 subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python-apt_0.7.4ubuntu6_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Michael R. Head (burner) wrote :

and of course, since I can't install python-apt, do-release-upgrade fails:

burner@firewall:~$ sudo do-release-upgrade -d
Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 5, in <module>
    import apt
ImportError: No module named apt

Revision history for this message
Michael R. Head (burner) wrote :

Perhaps a dupe of bug #146956

Revision history for this message
Michael R. Head (burner) wrote :

which in turn is a dupe of bug #146943. Of course, 146943 is about an upgrade to gutsy, whereas this is an LTS-LTS upgrade failure.

Revision history for this message
Michael R. Head (burner) wrote :

Here's an interesting workaround I just discovered.

I copied /usr/bin/pycentral from one of my gutsy (!) machines onto the machine that failed the dapper->hardy upgrade and I was able to get python-apt to install.

I've now restarted the "do-release-upgrade -d" process.

Revision history for this message
Gordon Hopper (gohopper) wrote : hardy upgrade failed (python-apt)

I had the same issue with a gutsy (7.10) to hardy (8.04) upgrade. I used the "modify /etc/apt/sources.list; apt-get update; apt-get dist-upgrade" method.
I have the sugar packages (which use Python) installed from http://ppa.launchpad.net/jani/ubuntu , but I do not thing that was related.

The error looked something like this (see attached var_log_apt_term.log):

Preparing to replace python-apt 0.7.3.1ubuntu4 (using .../python-apt_0.7.4ubuntu5_i386.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 1593, in <module>
    main()
  File "/usr/bin/pycentral", line 1587, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 1075, in run
    requested = pyversions.requested_versions_for_runtime(version_field, version_only=True)
  File "/usr/share/pycentral-data/pyversions.py", line 172, in requested_versions_for_runtime
    vinfo = parse_versions(vstring)
  File "/usr/share/pycentral-data/pyversions.py", line 58, in parse_versions
    raise ValueError, 'error parsing Python-Version attribute'
ValueError: error parsing Python-Version attribute

After this, everything blew up. The install/upgrade would not continue, because apt refused to configure any packages for which the dependencies failed. (It's amazing how many packages are somehow dependant on python). The system was unusable.

After poking around a bit, and using the above stack trace to get in a little over my head, I commented out line 1587 of /usr/bin/pycentral, which says:
    rv = action.run(global_options)

After this, apt agreed to configure the remaining packages. However, I DO NOT RECOMMEND this approach, since it breaks some python packages.

Perhaps a try/catch block somewhere in this call stack would prevent the error from upgrading this package. This might be a bug in python-central

Revision history for this message
Matthias Klose (doko) wrote :

this should be fixed when having the recent python-central package installed (0.5.60-0ubuntu4)

Changed in python-apt:
status: New → Fix Released
Revision history for this message
Gordon Hopper (gohopper) wrote :

"chmod 000 /usr/bin/pycentral" may also work as a work-around. This may depend on the versions of the old packages that are being removed.

When finished, a reinstall of python-central should complete the deferred byte-compiles.

Indeed, this looks very similar to bug #146943

Michael Vogt (mvo)
Changed in python-central:
status: New → Invalid
status: Invalid → New
Changed in update-manager:
status: New → Invalid
Revision history for this message
Matthias Klose (doko) wrote :

fixed in 0.6.1ubuntu3

Changed in python-central:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.