1

I ran apt-get build-dep wine1.6, because I wanted to install wine but apt install wine1.6 said that too many packages were not installed.

After the build dependencies were downloaded, dpkg returned an error because isdnlog failed to configure. I ran dpkg --configure -a which gave something similar to the following, which is the resultant output from apt install -f (TL;DR just many many dependencies):

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
33 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python-scour (0.26-3ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-scour (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of cdbs:
 cdbs depends on python-scour; however:
  Package python-scour is not configured yet.

dpkg: error processing package cdbs (--configure):
 dependency problems - leaving unconfigured
Setting up dblatex (0.3.5-2) ...
mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN... 
mktexlsr: Done.
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package dblatex (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-libarchive-c (2.1-3) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-libarchive-c (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-magic (1:5.22+15-2ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-magic (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-rpm (4.12.0.1+dfsg1-3build2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-rpm (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of diffoscope:
 diffoscope depends on python-libarchive-c; however:
  Package python-libarchive-c is not configured yet.
 diffoscope depends on python-magic; however:
  Package python-magic is not configured yet.
 diffoscope depends on python-rpm; however:
  Package python-rpm is not configured yet.

dpkg: error processing package diffoscope (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of debbindiff:
 debbindiff depends on diffoscope; however:
  Package diffoscope is not configured yet.

dpkg: error processing package debbindiff (--configure):
 dependency problems - leaving unconfigured
Setting up python-wstools (0.4.3-3) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-wstools (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-defusedxml (0.4.1-2build1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-defusedxml (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-soappy:
 python-soappy depends on python-wstools; however:
  Package python-wstools is not configured yet.
 python-soappy depends on python-defusedxml; however:
  Package python-defusedxml is not configured yet.

dpkg: error processing package python-soappy (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-debianbts:
 python-debianbts depends on python-soappy; however:
  Package python-soappy is not configured yet.

dpkg: error processing package python-debianbts (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-reportbug:
 python-reportbug depends on python-debianbts (>= 1.13); however:
  Package python-debianbts is not configured yet.

dpkg: error processing package python-reportbug (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of reportbug:
 reportbug depends on python-reportbug (= 6.6.5ubuntu1); however:
  Package python-reportbug is not configured yet.

dpkg: error processing package reportbug (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of debian-el:
 debian-el depends on reportbug (>= 4.12); however:
  Package reportbug is not configured yet.

dpkg: error processing package debian-el (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dpkg-dev-el:
 dpkg-dev-el depends on debian-el (>= 33.2); however:
  Package debian-el is not configured yet.

dpkg: error processing package dpkg-dev-el (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of devscripts-el:
 devscripts-el depends on dpkg-dev-el; however:
  Package dpkg-dev-el is not configured yet.

dpkg: error processing package devscripts-el (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gnome-pkg-tools:
 gnome-pkg-tools depends on python-scour; however:
  Package python-scour is not configured yet.

dpkg: error processing package gnome-pkg-tools (--configure):
 dependency problems - leaving unconfigured
Setting up libglib2.0-dev (2.46.2-1ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package libglib2.0-dev (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of libgstreamer0.10-dev:
 libgstreamer0.10-dev depends on libglib2.0-dev; however:
  Package libglib2.0-dev is not configured yet.

dpkg: error processing package libgstreamer0.10-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libgstreamer-plugins-base0.10-dev:
 libgstreamer-plugins-base0.10-dev depends on libgstreamer0.10-dev (>= 0.10.36); however:
  Package libgstreamer0.10-dev is not configured yet.
 libgstreamer-plugins-base0.10-dev depends on libglib2.0-dev; however:
  Package libglib2.0-dev is not configured yet.

dpkg: error processing package libgstreamer-plugins-base0.10-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpulse-dev:amd64:
 libpulse-dev:amd64 depends on libglib2.0-dev; however:
  Package libglib2.0-dev is not configured yet.

dpkg: error processing package libpulse-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up python-apipkg (1.0-1.1build1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-apipkg (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-execnet:
 python-execnet depends on python-apipkg; however:
  Package python-apipkg is not configured yet.

dpkg: error processing package python-execnet (--configure):
 dependency problems - leaving unconfigured
Setting up python-funcsigs (0.4-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-funcsigs (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-py (1.4.30-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-py (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-pytest:
 python-pytest depends on python-py (>= 1.4.29); however:
  Package python-py is not configured yet.

dpkg: error processing package python-pytest (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-pytest-xdist:
 python-pytest-xdist depends on python-execnet (>= 1.0.9); however:
  Package python-execnet is not configured yet.
 python-pytest-xdist depends on python-py; however:
  Package python-py is not configured yet.
 python-pytest-xdist depends on python-pytest; however:
  Package python-pytest is not configured yet.

dpkg: error processing package python-pytest-xdist (--configure):
 dependency problems - leaving unconfigured
Setting up python-urwid (1.2.1-2build1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-urwid (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up isdnlog (1:3.25+dfsg1-3.5ubuntu1) ...
Job for isdnutils-base.service failed because the control process exited with error code. See "systemctl status isdnutils-base.service" and "journalctl -xe" for details.
invoke-rc.d: initscript isdnutils-base, action "reload" failed.
dpkg: error processing package isdnlog (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-pbr (1.8.0-2ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in 
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in 
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-pbr (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-mock:
 python-mock depends on python-funcsigs; however:
  Package python-funcsigs is not configured yet.
 python-mock depends on python-pbr; however:
  Package python-pbr is not configured yet.

dpkg: error processing package python-mock (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of rpmlint:
 rpmlint depends on python-rpm; however:
  Package python-rpm is not configured yet.

dpkg: error processing package rpmlint (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-scour
 cdbs
 dblatex
 python-libarchive-c
 python-magic
 python-rpm
 diffoscope
 debbindiff
 python-wstools
 python-defusedxml
 python-soappy
 python-debianbts
 python-reportbug
 reportbug
 debian-el
 dpkg-dev-el
 devscripts-el
 gnome-pkg-tools
 libglib2.0-dev
 libgstreamer0.10-dev
 libgstreamer-plugins-base0.10-dev
 libpulse-dev:amd64
 python-apipkg
 python-execnet
 python-funcsigs
 python-py
 python-pytest
 python-pytest-xdist
 python-urwid
 isdnlog
 python-pbr
 python-mock
 rpmlint

E: Sub-process /usr/bin/dpkg returned an error code (1)

Every subsequent run of either of those commands or installation of packages mentioned as being required, just lengthens the list of uninstallable packages.

I've had my fair share of run-ins with apt in the past, but this is unlike anything I've ever encountered. How can I resolve this?

4

Check whether there is a symlink from /usr/bin/python to /usr/bin/python3.x. If there is, remove the symlink and relink to /usr/bin/python2.7

$ sudo ln -s /usr/bin/python2.7 /usr/bin/python
2

This problem is about version conflict or configurations on python. Please try the following commands which work for my case:

sudo apt-get purge python python3 

And then

sudo apt-get clean
# sudo apt-get autoremove -f 
sudo apt-get update

sudo apt-get install python python3

After these two command the environment is fixed and you could do anything else with sudo apt-get. Please be careful this will completely remote your python environment.

1

You a problem with ConfigParser as the error message tells that it is could not be loaded.

$ locate ConfigParser
/usr/lib/python2.7/ConfigParser.py
/usr/lib/python2.7/ConfigParser.pyc
/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeConfigParser.py
/usr/lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradeConfigParser.cpython-34.pyc

$ dpkg -S /usr/lib/python2.7/ConfigParser.py
libpython2.7-minimal:amd64: /usr/lib/python2.7/ConfigParser.py

As in the current situation, May be you can't reinstall it using apt.

  1. Download the libpython2.7-minimal corresponds to your system arch from:

    http://packages.ubuntu.com/wily/libpython2.7-minimal

    (I expect that you are using wily for the version of packages in the output you provided. If you are using other release, select the correct one from the top right corner)

  2. Open it with archive manager → again data.tar.gz

  3. Extract /usr/lib/python2.7/ConfigParser.py
  4. Then move it the installation path

    sudo mv ~/Downloads/ConfigParser.py /usr/lib/python2.7/ConfigParser.py
    
  5. Fix its owner

    sudo chown root:root /usr/lib/python2.7/ConfigParser.py
    
  6. Try again with sudo dpkg --configure -a to complete the previous installation.

  • 1
    Ah, ahah, I see, I didn't take a very close look at the error message. The real problem is that I symlinked /usr/bin/python to /usr/bin/python3.5 which undoubtedly doesn't have ConfigParser. I'll revert the symlink to point at /usr/bin/python2.7, but I think I'm gonna file a bug against coreubuntu about why a specific version of Python isn't used, just wherever /usr/bin/python happens to point. – cat Jan 2 '16 at 12:29
  • @cat , Yep, good that you figured out and i agree that it should use /usr/bin/python2 as recommended here python.org/dev/peps/pep-0394 – user.dz Jan 2 '16 at 16:13

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.