While upgrading to 17.04: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

Bug #1682820 reported by Jonathan Hartley
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python3-defaults (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

I got this error while upgrading from 16.10 to 17.04, along with the same Python traceback as below. After a reboot, I seem to now be on 17.04.

I had just successfully upgraded from 16.04 to 16.10 with no problems.

When the error occurred, I was advised by a dialog to try the following command, which produced a very similar error, with traceback.

$ sudo apt-get install -f
[sudo] password for jhartley:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  account-plugin-tools account-plugin-ubuntuone cgmanager comerr-dev
  dns-root-data dnsmasq-base gdebi-core gir1.2-accounts-1.0 gir1.2-signon-1.0
  hwdata imagemagick-common krb5-multidev libavcodec-ffmpeg-extra56
  libavfilter-ffmpeg5 libavformat-ffmpeg56 libavresample-ffmpeg2
  libavutil-ffmpeg54 libbasicusageenvironment1 libbluray1 libbonobo2-0
  libbonobo2-common libbonoboui2-0 libbonoboui2-common
  libboost-date-time1.61.0 libboost-filesystem1.61.0 libboost-iostreams1.61.0
  libboost-locale1.61.0 libboost-log1.61.0 libboost-program-options1.61.0
  libboost-regex1.61.0 libboost-serialization1.61.0 libboost-thread1.61.0
  libcddb2 libchromaprint0 libdirectfb-1.2-9 libdvbpsi10 libebml4v5 libfwup0
  libglade2-0 libglew1.13 libgnome-2-0 libgnome2-0 libgnome2-bin
  libgnome2-common libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0
  libgnomeui-common libgnomevfs2-0 libgnomevfs2-common libgroupsock8
  libgssrpc4 libiso9660-8 libjasper1 libjson-c3:i386 libjsoncpp1
  libkadm5clnt-mit10 libkadm5clnt-mit11 libkadm5srv-mit10 libkadm5srv-mit11
  libkdb5-8 liblircclient0 liblivemedia52 liblivemedia57 libllvm3.8
  libllvm3.8:i386 liblouis10 libmatroska6v5 libmimic0 libmircommon6
  libmirplatform13 libmirserver41 libonig2 libopencv-contrib2.4v5
  libopencv-legacy2.4v5 libopencv-ml2.4v5 libopenjpeg5 libopenmpt-modplug1
  liborbit-2-0 liborcus-0.11-0 libpam-cgfs libpay2 libperl5.22 libpoppler61
  libpostproc-ffmpeg53 libraw15 libreoffice-style-human libresid-builder0c2a
  libsidplay2v5 libswresample-ffmpeg1 libswscale-ffmpeg3 libubuntu-app-launch3
  libubuntuoneauth-2.0-0 libupnp6 libusageenvironment3 libvcdinfo0 libvlc-bin
  libvlc5 libvpx3 libwebp5 libx265-79 libx86-1 libxapian22v5
  linux-image-4.4.0-72-generic linux-image-extra-4.4.0-72-generic lp-solve
  mir-platform-graphics-mesa-kms10 mir-platform-graphics-mesa-x10
  mir-platform-input-evdev5 oxygen5-icon-theme pay-service pay-ui
  perl-modules-5.22 pm-utils qml-module-ubuntuone
  qtdeclarative5-ubuntu-web-plugin snap-confine system-config-printer-gnome
  ubuntu-push-client ubuntuone-credentials-common unity-scope-click vbetool
  vlc-bin vlc-data vlc-nox vlc-plugin-base
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python3
Suggested packages:
  python3-doc python3-tk python3-venv
The following packages will be upgraded:
  python3
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
12 not fully installed or removed.
Need to get 0 B/8,696 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                            Errors were encountered while processing:
 python3.5-minimal
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

And, FWIW:

$ apt-cache policy python3-minimal
python3-minimal:
  Installed: 3.5.3-1
  Candidate: 3.5.3-1
  Version table:
 *** 3.5.3-1 500
        500 http://gb.archive.ubuntu.com/ubuntu zesty/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Package
DistroRelease: Ubuntu 17.04
Package: python3 3.5.1-4
ProcVersionSignature: Ubuntu 4.10.0-19.21-generic 4.10.8
Uname: Linux 4.10.0-19-generic x86_64
ApportVersion: 2.20.4-0ubuntu4
Architecture: amd64
Date: Thu Apr 13 22:18:17 2017
ErrorMessage: pre-dependency problem - not installing python3
InstallationDate: Installed on 2015-07-28 (626 days ago)
InstallationMedia: Ubuntu 14.04.2 LTS "Trusty Tahr" - Release amd64 (20150218.1)
RelatedPackageVersions:
 dpkg 1.18.10ubuntu2
 apt 1.4
SourcePackage: python3-defaults
Title: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3
UpgradeStatus: Upgraded to zesty on 2017-04-14 (0 days ago)

Revision history for this message
Jonathan Hartley (tartley) wrote :
Revision history for this message
dino99 (9d9) wrote :

Your dialog comments says it all:

***
The following packages will be upgraded:
  python3
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
12 not fully installed or removed.
******

That it; clean your system first: its easy via synaptic.
Does not forget to always purge the removed packages to avoid old settings left behind, which can seriously disturb the system.

Changed in python3-defaults (Ubuntu):
status: New → Incomplete
Revision history for this message
Jonathan Hartley (tartley) wrote :

I can't install synaptic, or anything else, because 'apt' fails to run, with:

$ apt-cache policy python3-minimal
python3-minimal:
  Installed: 3.5.3-1
  Candidate: 3.5.3-1
  Version table:
 *** 3.5.3-1 500
        500 http://gb.archive.ubuntu.com/ubuntu zesty/main amd64 Packages
        100 /var/lib/dpkg/status

Is there another way I can do the cleaning?

Revision history for this message
Jonathan Hartley (tartley) wrote :

Apologies, the comment above should have read:

$ sudo apt install synaptic
[sudo] password for jhartley:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 python3 : PreDepends: python3-minimal (= 3.5.1-4) but 3.5.3-1 is to be installed
           Depends: libpython3-stdlib (= 3.5.1-4) but 3.5.3-1 is to be installed
 python3-dev : Depends: python3 (= 3.5.3-1) but 3.5.1-4 is to be installed
 synaptic : Depends: libept1.5.0 but it is not going to be installed
            Recommends: rarian-compat but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Revision history for this message
Jonathan Hartley (tartley) wrote :

Other potentially useful apt commands also fail with the same error:

apt --fix-broken install
apt autoremove

Revision history for this message
Aydi Nebil (aydi.nebil) wrote :

same problem :(

Revision history for this message
Apport retracing service (apport) wrote : This bug is a duplicate

Thank you for taking the time to report this crash and helping to make this software better. This particular crash has already been reported and is a duplicate of bug #1682934, so is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Please continue to report any other bugs you may find.

tags: removed: need-duplicate-check
Revision history for this message
Brian Murray (brian-murray) wrote :

You likely have a version of python3.5 installed in /usr/local/bin. Please remove that and then run 'sudo apt-get -f install.'

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.