Page 1 of 1

Errors with dpkg

Posted: Fri Dec 18, 2015 1:49 am
by Whats_myname
Ofen when i try to execute some commands or install something - terminal show errors like that :

Code: Select all

$ sudo apt-get install -fm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amarok-common caja-folder-color-switcher folder-color-switcher fonts-noto
  gcalctool gir1.2-caja gnome-calculator gnome-system-tools kde-runtime-data
  libgcrypt20 libkubuntu0 liblastfm1 libloudmouth1-0 libmygpo-qt1
  libntrack-qt4-1 libntrack0 libqapt2 libqapt2-runtime libqtscript4-core
  libqtscript4-gui libqtscript4-network libqtscript4-sql libqtscript4-uitools
  libqtscript4-xml libtag-extras1 ntrack-module-libnl-0
  plasma-scriptengine-javascript python-caja python-colorama
  python-colorama-whl python-distlib python-distlib-whl python-html5lib
  python-html5lib-whl python-requests-whl python-setuptools-whl python-six-whl
  python-urllib3-whl
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 178 not upgraded.
20 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python-samba (2:4.1.6+dfsg-1ubuntu2.14.04.9) ...
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-samba (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of samba-common-bin:
 samba-common-bin depends on python-samba; however:
  Package python-samba is not configured yet.

dpkg: error processing package samba-common-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba:
 samba depends on python-samba; however:
  Package python-samba is not configured yet.
 samba depends on samba-common-bin (= 2:4.1.6+dfsg-1ubuntu2.14.04.9); however:
  Package samba-common-bin is not configured yet.

dpkg: error processing package samba (--configure):
 dependency problems - leaving unconfigured
Setting up asciidoc (8.6.9-2ubuntu1) ...
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 asciidoc (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up gyp (0.1~svn1729-3ubuntu1) ...
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 gyp (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up lsb-release (4.1+Debian11ubuntu6mint1) ...
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 lsb-release (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mintupdate (4.9.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 mintupdate (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mozo (1.10.1-1+rafaela) ...
  File "/usr/sbin/update-python-modules", line 52
    print x
          ^
SyntaxError: Missing parentheses in call to 'print'
dpkg: error processing package mozo (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-colorama (0.2.5-0.1ubuntu2) ...
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-colorama (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-commandnotfound:
 python-commandnotfound depends on lsb-release; however:
  Package lsb-release is not configured yet.

dpkg: error processing package python-commandnotfound (--configure):
 dependency problems - leaving unconfigured
Setting up python-distlib (0.1.8-1ubuntu1) ...
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-distlib (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-html5lib (0.999-3~ubuntu1) ...
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-html5lib (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-mutagen (1.22-1ubuntu2) ...
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-mutagen (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-setuptools (3.3-1ubuntu2) ...
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-setuptools (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-simplejson (3.3.1-1ubuntu6) ...
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-simplejson (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-urllib3 (1.7.1-1ubuntu4) ...
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-urllib3 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up soundconverter (2.1.5-1~trusty) ...
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 soundconverter (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of node-gyp:
 node-gyp depends on gyp; however:
  Package gyp is not configured yet.

dpkg: error processing package node-gyp (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of npm:
 npm depends on node-gyp (>= 0.10.9); however:
  Package node-gyp is not configured yet.

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

dpkg: error processing package sessioninstaller (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-samba
 samba-common-bin
 samba
 asciidoc
 gyp
 lsb-release
 mintupdate
 mozo
 python-colorama
 python-commandnotfound
 python-distlib
 python-html5lib
 python-mutagen
 python-setuptools
 python-simplejson
 python-urllib3
 soundconverter
 node-gyp
 npm
 sessioninstaller
E: Sub-process /usr/bin/dpkg returned an error code (1)
help please, what does it means, what should i do?

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 5:32 am
by tolkien
It seems that some python modules are missing. Check that you have python installed.
Also check that you have the module ConfigParser using:
ls /usr/lib/python2.7 | awk '/^C/{print $0}'

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 7:26 am
by Whats_myname
tolkien wrote:It seems that some python modules are missing. Check that you have python installed.
Also check that you have the module ConfigParser using:
ls /usr/lib/python2.7 | awk '/^C/{print $0}'

Code: Select all

python --version
Python 3.4.3

Code: Select all

$ ls /usr/lib/python2.7 | awk '/^C/{print $0}'
CGIHTTPServer.py
CGIHTTPServer.pyc
ConfigParser.py
ConfigParser.pyc
ConfigParser.pyo
Cookie.py
Cookie.pyc
it seems that i have python right? ....

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 9:27 am
by tolkien
I think you need the 2.7 version with the missing module.
Try entering this: python2.7 --version. Do you get the version back?
Edit: yes, apparently they have changed the module name to "configparser" in Python 3.

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 11:34 am
by Whats_myname
tolkien wrote:I think you need the 2.7 version with the missing module.
Try entering this: python2.7 --version. Do you get the version back?
Edit: yes, apparently they have changed the module name to "configparser" in Python 3.

Code: Select all

$  python2.7 --version
Python 3.4.3
what should i do ?

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 11:57 am
by tolkien
Check with Synaptic Package Manager that python 2.7 is installed, and if not install it.
If it is, type this in the terminal to list the python executables:
ls -l /usr/bin | grep python

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 3:40 pm
by Whats_myname
tolkien wrote:Check with Synaptic Package Manager that python 2.7 is installed, and if not install it.
If it is, type this in the terminal to list the python executables:
ls -l /usr/bin | grep python

Code: Select all

$ ls -l /usr/bin | grep python
lrwxrwxrwx 1 root root          26 Jul 16 20:13 dh_pypy -> ../share/dh-python/dh_pypy
-rwxr-xr-x 1 root root        1056 Dec 21  2013 dh_python2
lrwxrwxrwx 1 root root          29 Jul 16 20:13 dh_python3 -> ../share/dh-python/dh_python3
lrwxrwxrwx 1 root root          23 Jun 22 21:51 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root          23 Oct 15 00:42 pdb3.4 -> ../lib/python3.4/pdb.py
lrwxrwxrwx 1 root root          31 Oct  4  2014 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root          26 Jul 16 20:13 pybuild -> ../share/dh-python/pybuild
lrwxrwxrwx 1 root root          18 Dec 15 17:22 python -> /usr/bin/python2.7
lrwxrwxrwx 1 root root           9 Oct  4  2014 python2 -> python2.7
lrwxrwxrwx 1 root root          16 Sep 26 12:34 python2.7 -> /usr/bin/python3
lrwxrwxrwx 1 root root           9 Oct  4  2014 python3 -> python3.4
-rwxr-xr-x 2 root root     3709944 Oct 15 00:42 python3.4
-rwxr-xr-x 2 root root     3709944 Oct 15 00:42 python3.4m
lrwxrwxrwx 1 root root          10 Oct  4  2014 python3m -> python3.4m
lrwxrwxrwx 1 root root          29 Oct  4  2014 pyversions -> ../share/python/pyversions.py
i have additional problem- i cant run update manager from main menu - maybe its based on the same problem with pythons....?

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 4:08 pm
by cwsnyder
Update manager will not run while there remain problems with a previous update. You can also run into real problems similar to these if your Python package installations 'pinned' any repository to restrict package updates to keep from breaking a Python application. One reason I dislike interpreted shell script languages. For more information on apt pinning search for 'apt-pinning', 'repository pinning', or 'AptPreferences'.

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 4:40 pm
by Whats_myname
but what should i do please, help me.

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 4:44 pm
by WharfRat
Your problem is with this entry

Code: Select all

lrwxrwxrwx 1 root root          16 Sep 26 12:34 python2.7 -> /usr/bin/python3
that overwrote the required python2.7 file. I don't know what else you might have done here, but you can try downloading python2.7-minimal and moving it to /usr/bin.

Does this work downloading python2.7-minimal :?:

Code: Select all

cd ~

Code: Select all

mkdir temp

Code: Select all

cd temp

Code: Select all

apt-get download python2.7-minimal

Code: Select all

dpkg-deb -x python2.7-minimal* .

Code: Select all

sudo mv ./usr/bin/python2.7 /usr/bin

Code: Select all

cd ..

Code: Select all

rm -r temp

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 5:01 pm
by Whats_myname
WharfRat wrote:Your problem is with this entry

Code: Select all

lrwxrwxrwx 1 root root          16 Sep 26 12:34 python2.7 -> /usr/bin/python3
that overwrote the required python2.7 file. I don't know what else you might have done here, but you can try downloading python2.7-minimal and moving it to /usr/bin.

Does this work downloading python2.7-minimal :?:

Code: Select all

cd ~

Code: Select all

mkdir temp

Code: Select all

cd temp

Code: Select all

apt-get download python2.7-minimal

Code: Select all

dpkg-deb -x python2.7-minimal* .

Code: Select all

sudo mv ./usr/bin/python2.7 /usr/bin

Code: Select all

cd ..

Code: Select all

rm -r temp
This work! Update manager arrived. Thank you. Please tell what sources should i read to know something more about what happens in my Linux system? i want to be strong as you

Re: Errors with dpkg

Posted: Fri Dec 18, 2015 5:32 pm
by WharfRat
Whats_myname wrote: This work! Update manager arrived. Thank you. Please tell what sources should i read to know something more about what happens in my Linux system? i want to be strong as you
Your best near-term practice is to not mess with anything that will mess with your system files. Stick with the repo packages.

The man pages are a good start to understanding the linux system.

Good luck :wink: