Ubuntu 上 python2.7 包未满足依赖性问题

Ubuntu 上 python2.7 包未满足依赖性问题

我对 ubuntu 操作系统还很陌生,在不知不觉中我可能修改了一些软件包,最终遇到了 python2.7-minimal、python-2.7-stdlib、python2.7-stdlibrary 依赖问题。

我尝试使用

sudo apt-get -f install我得到了以下输出

Reading package lists... Done
Building dependency tree 
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb dmeventd dmraid dpkg-repack gir1.2-timezonemap-1.0
  gir1.2-xkl-1.0 kpartx kpartx-boot libappstream3 libdebian-installer4
  libdevmapper-event1.02.1 libdmraid1.0.0.rc16 liblockfile-bin liblockfile1
  liblvm2app2.2 liblvm2cmd2.02 libparted-fs-resize0 libreadline5
  lockfile-progs lvm2 os-prober pmount python3-icu python3-pam rdate
  ubiquity-casper ubiquity-ubuntu-artwork
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  add-apt-key apt apt-utils aptdaemon libapt-inst2.0 libapt-pkg5.0
  libpython2.7-minimal libpython2.7-stdlib libqt4-designer libqt4-help
  libqt4-opengl libqt4-scripttools libqt4-svg libqt4-test
  libqtassistantclient4 libqtwebkit4 python-apt python-bs4 python-chardet
  python-html5lib python-lxml python-mechanize python-pkg-resources python-qt4
  python-sip python-six python2.7-minimal python3-aptdaemon
  python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat
Suggested packages:
  aptitude | synaptic | wajig apt-doc python-apt-dbg python-apt-doc
  python-genshi python-lxml-dbg python-lxml-doc python-setuptools
  python-qt4-dbg binfmt-support
The following NEW packages will be installed:
  add-apt-key libqt4-designer libqt4-help libqt4-opengl libqt4-scripttools
  libqt4-svg libqt4-test libqtassistantclient4 libqtwebkit4 python-apt
  python-bs4 python-chardet python-html5lib python-lxml python-mechanize
  python-pkg-resources python-qt4 python-sip python-six
The following packages will be upgraded:
  apt apt-utils aptdaemon libapt-inst2.0 libapt-pkg5.0 libpython2.7-minimal
  libpython2.7-stdlib python2.7-minimal python3-aptdaemon
  python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat
11 upgraded, 19 newly installed, 0 to remove and 675 not upgraded.
5 not fully installed or removed.
Need to get 0 B/21.0 MB of archives.
After this operation, 69.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: error processing package debconf (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试重新安装 python2.7 并且尝试升级任何命令,但得到的只是以下错误:

$ sudo apt-get install --reinstall python2.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libpython2.7 : Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.13) but 2.7.11-7ubuntu1 is to be installed
 python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.13) but 2.7.11-7ubuntu1 is to be installed
             Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.13) but 2.7.11-7ubuntu1 is to be installed

这是 apt 缓存策略的输出:

$ sudo apt-cache policy python
python:
  Installed: 2.7.11-1
  Candidate: 2.7.12-1~16.04
  Version table:
     2.7.12-1~16.04 500
        500 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main arm64 Packages
     2.7.11-1 500
        500 http://ports.ubuntu.com/ubuntu-ports xenial/main arm64 Packages
        100 /var/lib/dpkg/status

sudo apt 自动删除

正在读取软件包列表...完成 正在构建依赖关系树
正在读取状态信息...完成 您可能需要运行“apt-get -f install”来更正这些问题。 以下软件包具有未满足的依赖关系:libpython2.7:依赖:libpython2.7-stdlib(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1 python2.7:依赖:python2.7-minimal(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1 依赖:libpython2.7-stdlib(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1

sudo apt 更新 点击数:1http://ppa.launchpad.net/deadsnakes/ppa/ubuntuxenial 发布热度:2http://ports.ubuntu.com/ubuntu-portsxenial 发布热度:3http://ports.ubuntu.com/ubuntu-portsxenial-updates 发布中点击数:4http://ports.ubuntu.com/ubuntu-portsxenial-security InRelease 正在读取软件包列表... 完成 正在构建依赖关系树
正在读取状态信息... 完成 686 个软件包可以升级。运行“apt list --upgradable”即可查看。

sudo apt 升级

正在读取软件包列表...完成 正在构建依赖关系树
正在读取状态信息...完成 您可能需要运行“apt-get -f install”来更正这些问题。 以下软件包具有未满足的依赖关系:libpython2.7:依赖:libpython2.7-stdlib(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1 python2.7:依赖:python2.7-minimal(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1 依赖:libpython2.7-stdlib(= 2.7.12-1ubuntu0~16.04.13),但已安装 2.7.11-7ubuntu1

我对此很陌生。请帮忙

相关内容