使用 apt-get install 或 remove 时出错

使用 apt-get install 或 remove 时出错

我是 Ubuntu 的新手,但我正在运行 VPS(Ubuntu Xenial(16.04))。

当我尝试删除或安装某些东西时,Python 出现很多错误。

有人有解决方案吗?

编辑:添加了整个日志,这是删除程序 svtplay-dl 的输出。

gel@gel:/var/www/gustavelmgren.me/public_html$ sudo apt-get remove svtplay-dl 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libestr0 libjson-c2 python-cffi-backend python-chardet python-cryptography python-ndg-httpsclient python-openssl python-requests python-urllib3 rtmpdump
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  svtplay-dl
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
14 not fully installed or removed.
After this operation, 75.8 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 27718 files and directories currently installed.)
Removing svtplay-dl (0.30.2016.02.08-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up python-pkg-resources (20.7.0-1) ...
/var/lib/dpkg/info/python-pkg-resources.postinst: 6: /var/lib/dpkg/info/python-pkg-resources.postinst: pycompile: not found
dpkg: error processing package python-pkg-resources (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of python-chardet:
 python-chardet depends on python-pkg-resources; however:
  Package python-pkg-resources is not configured yet.

dpkg: error processing package python-chardet (--configure):
 dependency problems - leaving unconfigured
Setting up python-crypto (2.6.1-6build1) ...
/var/lib/dpkg/info/python-crypto.postinst: 6: /var/lib/dpkg/info/python-crypto.postinst: pycompile: not found
dpkg: error processing package python-crypto (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-enum34 (1.1.2-1) ...
/var/lib/dpkg/info/python-enum34.postinst: 6: /var/lib/dpkg/info/python-enum34.postinst: pycompile: not found
dpkg: error processing package python-enum34 (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-idna (2.0-3) ...
/var/lib/dpkg/info/python-idna.postinst: 6: /var/lib/dpkg/info/python-idna.postinst: pycompile: not found
dpkg: error processing package python-idna (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-ipaddress (1.0.16-1) ...
/var/lib/dpkg/info/python-ipaddress.postinst: 6: /var/lib/dpkg/info/python-ipaddress.postinst: pycompile: not found
dpkg: error processing package python-ipaddress (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-pyasn1 (0.1.9-1) ...
/var/lib/dpkg/info/python-pyasn1.postinst: 6: /var/lib/dpkg/info/python-pyasn1.postinst: pycompile: not found
dpkg: error processing package python-pyasn1 (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-six (1.10.0-3) ...
/var/lib/dpkg/info/python-six.postinst: 6: /var/lib/dpkg/info/python-six.postinst: pycompile: not found
dpkg: error processing package python-six (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of python-cryptography:
 python-cryptography depends on python-enum34; however:
  Package python-enum34 is not configured yet.
 python-cryptography depends on python-idna; however:
  Package python-idna is not configured yet.
 python-cryptography depends on python-ipaddress; however:
  Package python-ipaddress is not configured yet.
 python-cryptography depends on python-pkg-resources; however:
  Package python-pkg-resources is not configured yet.
 python-cryptography depends on python-pyasn1 (>= 0.1.8); however:
  Package python-pyasn1 is not configured yet.
 python-cryptography depends on python-six (>= 1.4.1); however:
  Package python-six is not configured yet.

dpkg: error processing package python-cryptography (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-openssl:
 python-openssl depends on python-cryptography (>= 0.7); however:
  Package python-cryptography is not configured yet.
 python-openssl depends on python-six; however:
  Package python-six is not configured yet.

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

dpkg: error processing package python-ndg-httpsclient (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-urllib3:
 python-urllib3 depends on python-six; however:
  Package python-six is not configured yet.

dpkg: error processing package python-urllib3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-requests:
 python-requests depends on python-urllib3 (>= 1.13.1); however:
  Package python-urllib3 is not configured yet.
 python-requests depends on python-chardet; however:
  Package python-chardet is not configured yet.
 python-requests depends on python-urllib3 (<< 1.13.2); however:
  Package python-urllib3 is not configured yet.

dpkg: error processing package python-requests (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-pkg-resources
 python-chardet
 python-crypto
 python-enum34
 python-idna
 python-ipaddress
 python-pyasn1
 python-six
 python-cryptography
 python-openssl
 python-ndg-httpsclient
 python-urllib3
 python-requests
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我跑步时:sudo dpkg --configure -a

dpkg: dependency problems prevent configuration of python-urllib3:
 python-urllib3 depends on python-six; however:
  Package python-six is not configured yet.

dpkg: error processing package python-urllib3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-chardet:
 python-chardet depends on python-pkg-resources; however:
  Package python-pkg-resources is not configured yet.

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

dpkg: error processing package python-openssl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-cryptography:
 python-cryptography depends on python-enum34; however:
  Package python-enum34 is not configured yet.
 python-cryptography depends on python-idna; however:
  Package python-idna is not configured yet.
 python-cryptography depends on python-ipaddress; however:
  Package python-ipaddress is not configured yet.
 python-cryptography depends on python-pkg-resources; however:
  Package python-pkg-resources is not configured yet.
 python-cryptography depends on python-pyasn1 (>= 0.1.8); however:
  Package python-pyasn1 is not configured yet.
 python-cryptography depends on python-six (>= 1.4.1); however:
  Package python-six is not configured yet.

dpkg: error processing package python-cryptography (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-requests:
 python-requests depends on python-urllib3 (>= 1.13.1); however:
  Package python-urllib3 is not configured yet.
 python-requests depends on python-chardet; however:
  Package python-chardet is not configured yet.
 python-requests depends on python-urllib3 (<< 1.13.2); however:
  Package python-urllib3 is not configured yet.

dpkg: error processing package python-requests (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-ndg-httpsclient:
 python-ndg-httpsclient depends on python-openssl; however:
  Package python-openssl is not configured yet.

dpkg: error processing package python-ndg-httpsclient (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-urllib3
 python-chardet
 python-openssl
 python-cryptography
 python-requests
 python-ndg-httpsclient

答案1

在终端中运行以下命令:

sudo apt-get --fix-missing --reinstall install python python-minimal dh-python
sudo apt-get -f install

我遇到过类似的问题,这个帮我解决了。

相关内容