2

Any time I try to install a package or upgrade using apt-get, I get the error below.

root@localhost# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/610 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up python-wheel (0.29.0-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-wheel (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: error processing package ipython (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Setting up python-configparser (3.3.0r2-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-configparser (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-pip (8.1.2-2ubuntu0.1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-pip (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python-wheel
 ipython
 python-configparser
 python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
0

2 Answers 2

3

This answer for another question, solved the problem I was having.

The root cause of the problems is a corrupted Python package, trying to reinstall the packages with the following commands:

sudo apt-get clean
sudo apt-get update
sudo apt-get install -f --reinstall libpython2.7-minimal python-configparser
-1

Try running following to correct package issues:

sudo apt-get check;sudo apt-get autoremove;sudo apt-get autoclean;

Also running following to update & upgrade:

sudo apt-get update && sudo apt-get upgrade
3
  • still having the same error whilst installing a package: apt-get install python-pip
    – Zac
    Feb 10, 2017 at 7:15
  • just try installing another package and revert if its specific to python-pip or not.
    – Aditya T
    Feb 10, 2017 at 7:22
  • its not specific to python-pip
    – Zac
    Feb 10, 2017 at 22:36

Not the answer you're looking for? Browse other questions tagged .