apt-get 错误:apt-listchanges 和 debconf

apt-get 错误:apt-listchanges 和 debconf

我反复收到此消息:

Setting up apt-listchanges (3.10) ...
Traceback (most recent call last):
  File "/tmp/tmp.aulCeycFHm.aptlc/debconf-helper.py", line 6, in <module>
    import debconf
ImportError: No module named 'debconf'
dpkg: error processing package apt-listchanges (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 apt-listchanges

德布会议

~$ dpkg --status debconf
Package: debconf
Status: install ok installed
Priority: required
Section: admin
Installed-Size: 558
Maintainer: Debconf Developers <[email protected]>
Architecture: all
Multi-Arch: foreign
Version: 1.5.60
Replaces: debconf-tiny
Provides: debconf-2.0
Pre-Depends: perl-base (>= 5.6.1-4)
Recommends: apt-utils (>= 0.5.1), debconf-i18n
Suggests: debconf-doc, debconf-utils, whiptail | dialog, libterm-readline-gnu-perl, libgtk2-perl (>= 1:1.130), libnet-ldap-perl, perl, libqtgui4-perl, libqtcore4-perl
Conflicts: apt (<< 0.3.12.1), cdebconf (<< 0.96), debconf-tiny, debconf-utils (<< 1.3.22), dialog (<< 0.9b-20020814-1), menu (<= 2.1.3-1), whiptail (<< 0.51.4-11), whiptail-utf8 (<= 0.50.17-13)
Conffiles:
 /etc/apt/apt.conf.d/70debconf 7e9d09d5801a42b4926b736b8eeabb73
 /etc/debconf.conf 8c0619be413824f1fc7698cee0f23811
Description: Debian configuration management system
 Debconf is a configuration management system for debian packages. Packages
 use Debconf to ask questions when they are installed.

ls -l /usr/lib/python*/dist-packages/debconf.py

ls -l /usr/lib/python*/dist-packages/debconf.py

答案1

这对你来说可能不再重要,但我找到了一个解决方法,至少对我来说。

debconf.py问题是它在您的路径上找不到。就我而言,它使用了不同的 python,其设置与我的路径上通常的设置不同。

我最终在/usr/lib/python3/dist-packages/debconf.py.对我来说,这是python3.6一条错误的路径,你可以通过执行以下操作找到它:

$ python3.6
>>> import sys
>>> sys.path

这表明它没有我的内容$PATH。我没有浪费太多时间,而是运行了这个:

# ln -s /usr/lib/python3/dist-packages/debconf.py /usr/local/lib/python3.6/site-packages

目的地可以是任何地方这显示在sys.path.您可能可以复制而不是符号链接。无论如何,这就是我所做的,它对我有用 - 我希望你也有类似的运气!

答案2

当我将计算服务器从 Debian 升级jessie到 Debian时,我开始收到此错误stretch

我的问题是,在升级到 之前,我(愚蠢地)在系统范围内手动安装了 Python 3.5 stretch,而该版本的 Python 正在“屏蔽”默认的stretchPython 3 安装。特别是,这些因素在发挥作用:

  • 我的手动 v3.5 安装已将其python3符号链接放入/usr/local/bin

  • Debianpython3系统软件包已将符号链接安装到/usr/bin

  • /usr/local/bin$PATH在我身上比以前更早/usr/bin

因此,为了解决这个特定问题,我所要做的就是将符号链接重命名/usr/local/bin/python3为,例如/usr/local/bin/python3-local,然后在调用import debconf后正常工作python3

更完整的解决方案可能是完全卸载系统范围内的手动版本的 Python 3.5,然后在沙盒中重新安装。

相关内容