dpkg: 处理软件包 python-setuptools (--configure)时出错: 依赖关系问题 - 仍未被配置

罗鸿福
2023-12-01

PCI-MT:~$ sudo apt install python-pip
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
python-pip-whl python-pkg-resources python-setuptools python-wheel
建议安装:
python-setuptools-doc
推荐安装:
python-all-dev
下列【新】软件包将被安装:
python-pip python-pip-whl python-pkg-resources python-setuptools
python-wheel
升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 1,544 kB 的归档。
解压缩后会消耗 3,006 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-pip-whl all 8.1.1-2 [1,074 kB]
获取:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-pip all 8.1.1-2 [144 kB]
获取:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pkg-resources all 20.7.0-1 [108 kB]
获取:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-setuptools all 20.7.0-1 [169 kB]
获取:5 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-wheel all 0.29.0-1 [48.0 kB]
已下载 1,544 kB,耗时 2秒 (553 kB/s)
正在选中未选择的软件包 python-pip-whl。
(正在读取数据库 ... 系统当前共安装有 222648 个文件和目录。)
正准备解包 .../python-pip-whl_8.1.1-2_all.deb ...
正在解包 python-pip-whl (8.1.1-2) ...
正在选中未选择的软件包 python-pip。
正准备解包 .../python-pip_8.1.1-2_all.deb ...
正在解包 python-pip (8.1.1-2) ...
正在选中未选择的软件包 python-pkg-resources。
正准备解包 .../python-pkg-resources_20.7.0-1_all.deb ...
正在解包 python-pkg-resources (20.7.0-1) ...
正在选中未选择的软件包 python-setuptools。
正准备解包 .../python-setuptools_20.7.0-1_all.deb ...
正在解包 python-setuptools (20.7.0-1) ...
正在选中未选择的软件包 python-wheel。
正准备解包 .../python-wheel_0.29.0-1_all.deb ...
正在解包 python-wheel (0.29.0-1) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 python-pip-whl (8.1.1-2) ...
正在设置 python-pip (8.1.1-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: 处理软件包 python-pip (--configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
正在设置 python-pkg-resources (20.7.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: 处理软件包 python-pkg-resources (--configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
dpkg: 依赖关系问题使得 python-setuptools 的配置工作不能继续:
python-setuptools 依赖于 python-pkg-resources (= 20.7.0-1);然而:
软件包 python-pkg-resources 尚未配置。

dpkg: 处理软件包 python-setuptools (--configure)时出错:
依赖关系问题 - 仍未被配置
正在设置 python-wheel (0.29.0-1) ...
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
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: 处理软件包 python-wheel (--configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
由于已经达到 MaxReports 限制,没有写入 apport 报告。
在处理时有错误发生:
python-pip
python-pkg-resources
python-setuptools
python-wheel
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决方案:

PCI-MT:~$ su root
密码:
# mv /var/lib/dpkg/info /var/lib/dpkg/info_bak
# mkdir /var/lib/dpkg/info
# apt-get update && apt-get -f install
命中:1 http://dl.google.com/linux/chrome/deb stable InRelease
命中:2 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:3 http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu xenial InRelease
正在读取软件包列表... 完成
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 4 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
正在设置 python-pip (8.1.1-2) ...
正在设置 python-pkg-resources (20.7.0-1) ...
正在设置 python-setuptools (20.7.0-1) ...
正在设置 python-wheel (0.29.0-1) ...
# mv /var/lib/dpkg/info/* /var/lib/dpkg/info_bak/
# rm -rf /var/lib/dpkg/info
# mv /var/lib/dpkg/info_bak /var/lib/dpkg/info
#

经过上面操作:

PCI-MT:~$ sudo apt install python-pip
[sudo] l 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python-pip 已经是最新版 (8.1.1-2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
PCI-MT:~$

 类似资料: