dpkg 处于无法解决的依赖循环中

dpkg 处于无法解决的依赖循环中

我运行了apt-get build-dep wine1.6,因为我想安装wine但是apt install wine1.6说太多包没有安装。

下载构建依赖项后,由于配置失败dpkg而返回错误。我运行后得到了类似以下内容的结果(TL;DR 只是很多依赖项):isdnlogdpkg --configure -aapt install -f

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)

随后每次运行这些命令或安装所需的软件包,都只会延长可卸载软件包的列表。

apt我以前也遇到过不少这样的问题,但这次的情况我以前从未遇到过。我该如何解决这个问题?

答案1

检查是否有从 /usr/bin/python 到 /usr/bin/python3.x 的符号链接。如果有,请删除符号链接并重新链接到 /usr/bin/python2.7

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

答案2

此问题与 python 版本冲突或配置有关。请尝试以下命令,它们对我的情况有效:

sudo apt-get purge python python3 

进而

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

sudo apt-get install python python3

执行完这两个命令后,环境就修复了,你可以用 做任何其他事情了sudo apt-get。请注意,这将完全远程控制你的 Python 环境。

答案3

您遇到了问题,ConfigParser因为错误消息表明无法加载。

$ 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

正如当前的情况一样,您可能无法使用 重新安装它apt

  1. 从以下位置下载libpython2.7-minimal与您的系统架构相对应的版本:

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

    (我希望您在提供的输出中使用 wily 作为软件包版本。如果您使用其他版本,请从右上角选择正确的版本)

  2. 再次使用档案管理器→打开它data.tar.gz

  3. 提炼/usr/lib/python2.7/ConfigParser.py
  4. 然后将其移动到安装路径

    sudo mv ~/Downloads/ConfigParser.py /usr/lib/python2.7/ConfigParser.py
    
  5. 修复其所有者

    sudo chown root:root /usr/lib/python2.7/ConfigParser.py
    
  6. 再试一次以sudo dpkg --configure -a完成之前的安装。

相关内容