0

OS: Ubuntu 14.04, amd_x64.

apt-get commands such as install, remove and purge fail with the same error as shown below

However commands like update and clean work fine.

Not sure how to resolve the issue. Take a look at my terminal session.

$ sudo apt-get install --reinstall lightdm
Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libpython3.3 : Depends: python3.3 (= 3.3.6-1+trusty1) but 3.3.2-7ubuntu4 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

$ sudo apt-get -f install -y
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  evolution-common libevolution libgtkhtml-4.0-0 libgtkhtml-4.0-common
  libgtkhtml-editor-4.0-0 libkactivities-models1 libmail-spf-perl
  libnetaddr-ip-perl libpst4 libytnef0 re2c sa-compile spamassassin spamc
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  python3.3 python3.3-minimal
Suggested packages:
  python3.3-doc
The following packages will be upgraded:
  python3.3 python3.3-minimal
2 upgraded, 0 newly installed, 0 to remove and 108 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,356 kB of archives.
After this operation, 10.8 MB of additional disk space will be used.
(Reading database ... 403449 files and directories currently installed.)
Preparing to unpack .../python3.3_3.3.6-1+trusty1_amd64.deb ...
Unpacking python3.3 (3.3.6-1+trusty1) over (3.3.2-7ubuntu4) ...
dpkg: error processing archive /var/cache/apt/archives/python3.3_3.3.6-1+trusty1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.3/asynchat.py', which is also in package libpython3.3-stdlib:amd64 3.3.2-7ubuntu4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
dpkg: considering deconfiguration of python3.3, which would be broken by installation of python3.3-minimal ...
dpkg: yes, will deconfigure python3.3 (broken by python3.3-minimal)
Preparing to unpack .../python3.3-minimal_3.3.6-1+trusty1_amd64.deb ...
De-configuring python3.3 (3.3.2-7ubuntu4) ...
Unpacking python3.3-minimal (3.3.6-1+trusty1) over (3.3.2-7ubuntu4) ...
dpkg: error processing archive /var/cache/apt/archives/python3.3-minimal_3.3.6-1+trusty1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.3/sre_compile.py', which is also in package libpython3.3-minimal:amd64 3.3.2-7ubuntu4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3.3_3.3.6-1+trusty1_amd64.deb
 /var/cache/apt/archives/python3.3-minimal_3.3.6-1+trusty1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ python --version
Python 2.7.6
$ python3 --version
Python 3.4.0
$ python3.3 --version
Python 3.3.2+
Zanna
  • 70,465

1 Answers1

3

Apparently nobody flagged the different versions of the Python packages as conflicting. Therefore apt-get cannot correctly resolve the dependencies and replace, remove, and add the packages in the right order.

As a workaround you can remove the conflicting packages manually while overriding dependency issues. You may need to play around a bit with the order (as I don't know the exact dependency chains here), but the general idea is to run

dpkg -r --force-depends libpython3.3-minimal libpython3.3-stdlib

This may crash/break running applications or system services relying on Python 3.3 and you may need to restart them after upgrading.

David Foerster
  • 36,264
  • 56
  • 94
  • 147