nayo
Posts: 2
Joined: Fri Jul 13, 2018 3:24 am

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

Fri Jul 13, 2018 3:39 am

HI guys, I am trying to install mopidy in my RPI. and this eroor occurs.

Code: Select all

E: Sub-process /usr/bin/dpkg returned an error code (1)
.
Then I tried to run

Code: Select all

sudo dpkg --configure -a 
I got:

Code: Select all

Setting up python-functools32 (3.2.3.2-3) ...
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-functools32 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-backports-abc (0.5-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-backports-abc (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-py (1.4.32-3) ...
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-py (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-joblib (0.10.3+git55-g660fe5d-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-joblib (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: error processing package python-pantilthat (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Setting up python-tz (2016.7-0.3) ...
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-tz (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: error processing package python-sense-emu (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of python-tornado:
 python-tornado depends on python-backports-abc; however:
  Package python-backports-abc is not configured yet.

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

dpkg: error processing package python-matplotlib (--configure):
 dependency problems - leaving unconfigured
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
Setting up python-cycler (0.10.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-cycler (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-pykka (1.2.1-3) ...
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-pykka (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-dateutil (2.5.3-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-dateutil (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-gobject-2 (2.28.6-13) ...
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-gobject-2 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-imaging (4.0.0-4) ...
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-imaging (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-sklearn:
 python-sklearn depends on python-joblib (>= 0.9.2); however:
  Package python-joblib is not configured yet.

dpkg: error processing package python-sklearn (--configure):
 dependency problems - leaving unconfigured
Setting up python-cairo (1.8.8-2.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-cairo (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-gst-1.0 (1.10.4-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-gst-1.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-opencv (2.4.9.1+dfsg1-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-opencv (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-decorator (4.0.11-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-decorator (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-concurrent.futures (3.0.5-3) ...
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-concurrent.futures (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-singledispatch (3.4.0.3-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-singledispatch (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-subprocess32 (3.2.7-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-subprocess32 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-nose (1.3.7-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-nose (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-pyparsing (2.1.10+dfsg1-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-pyparsing (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mopidy:
 mopidy depends on python-gst-1.0; however:
  Package python-gst-1.0 is not configured yet.
 mopidy depends on python-tornado (>= 2.3); however:
  Package python-tornado is not configured yet.
 mopidy depends on python-pykka; however:
  Package python-pykka is not configured yet.

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

dpkg: error processing package python-scipy (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-gtk2:
 python-gtk2 depends on python-cairo (>= 1.0.2-1.1); however:
  Package python-cairo is not configured yet.
 python-gtk2 depends on python-gobject-2 (>= 2.21.3); however:
  Package python-gobject-2 is not configured yet.

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

dpkg: error processing package python-glade2 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Errors were encountered while processing:
 python-functools32
 python-backports-abc
 python-py
 python-joblib
 python-pantilthat
 python-tz
 python-sense-emu
 python-tornado
 python-matplotlib
 python-pytest
 python-cycler
 python-pykka
 python-dateutil
 python-gobject-2
 python-imaging
 python-sklearn
 python-cairo
 python-gst-1.0
 python-opencv
 python-decorator
 python-concurrent.futures
 python-singledispatch
 python-subprocess32
 python-nose
 python-pyparsing
 mopidy
 python-scipy
 python-gtk2
 python-glade2

Code: Select all

sudo apt-get install -f

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python-pantilthat python-sense-emu
The following packages will be upgraded:
  python-pantilthat python-sense-emu
2 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
29 not fully installed or removed.
Need to get 0 B/209 kB of archives.
After this operation, 54.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Reading changelogs... Done
(Reading database ... 128238 files and directories currently installed.)
Preparing to unpack .../python-pantilthat_0.0.6_all.deb ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-pantilthat_0.0.6_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 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 while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to unpack .../python-sense-emu_1.1_all.deb ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-sense-emu_1.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 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 while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python-pantilthat_0.0.6_all.deb
 /var/cache/apt/archives/python-sense-emu_1.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
and also tried

Code: Select all

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
. All got the same error.

PLEASE HELP. Thanks!

mutrised
Posts: 44
Joined: Thu Nov 08, 2012 12:41 am
Location: France

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

Mon Jul 16, 2018 10:29 am

Hi,

Sorry I faced once or twice some problems with dpkg but I'm really not an expert...
Did you tried to cleanup dpkg cache ? With apt-get clean
RPI2B 7/24 - web, NAS/media, Owncloud and more
RPI0 7/24 - VPN, DHCP, DNS (including filtering), wakeonlan proxy
RPI0W - VPN gateway providing secure WIFI AP and network router, some kind of internet BOX when on the move ;)

nayo
Posts: 2
Joined: Fri Jul 13, 2018 3:24 am

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

Tue Jul 17, 2018 3:46 am

mutrised wrote:
Mon Jul 16, 2018 10:29 am
Hi,

Sorry I faced once or twice some problems with dpkg but I'm really not an expert...
Did you tried to cleanup dpkg cache ? With apt-get clean
yeah, I tried to use clean and autoclean, just don't work.
Thanks for the help.

Return to “Troubleshooting”