意外获取删除python后如何恢复

2024-04-29 04:20:28 发布

您现在位置:Python中文网/ 问答频道 /正文

是的。我做到了。太蠢了。

我不知道它会拉它的依赖关系,只想从头安装Python2和3(因为这个问题:https://askubuntu.com/questions/897355/how-to-change-default-idle-for-python)。

现在,我仍然可以使用我的终端,检查这些答案:

https://askubuntu.com/questions/741265/apt-get-remove-python-150mb-apt-get-install-python-687kb

https://askubuntu.com/questions/437644/i-accidentaly-did-sudo-apt-get-remove-python

但是,在运行sudo apt-get install ubuntu-desktop之后,会出现以下错误:

Setting up python-ldb (2:1.1.24-1ubuntu3) ...
/var/lib/dpkg/info/python-ldb.postinst: 6: /var/lib/dpkg/info/python-ldb.postinst: pycompile: not found
dpkg: error processing package python-ldb (--configure):
 subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
                                                              Setting up python-tdb (1.3.8-2) ...
/var/lib/dpkg/info/python-tdb.postinst: 6: /var/lib/dpkg/info/python-tdb.postinst: pycompile: not found
dpkg: error processing package python-tdb (--configure):
 subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python-samba:
 python-samba depends on python-crypto; however:
  Package python-crypto is not configured yet.
 python-samba depends on python-ldb (>= 1.1.2~); however:
  Package python-ldb is not configured yet.
 python-samba depends on python-tdb; however:
  Package python-tdb is not configured yet.

dpkg: error processing package python-samba (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Processing triggers for libc-bin (2.23-0ubuntu7) ...

Errors were encountered while processing:
 mercurial-common
 python-crypto
 python-dnspython
 python-ldb
 python-tdb
 python-samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

每个apt-get-install命令都会抛出这个命令。

有办法恢复这些依赖关系吗?


Tags: httpsinfogetisvarlibnotapt
3条回答

哈利路亚。

sudo apt-get install --reinstall python python-chardet python-colorama python-distlib python-django python-django-tables2 python-six python-html5lib python-lxml python-minimal python-pkg-resources python-setuptools python-urllib3 python-requests python-pip python-virtualenv

sudo apt-get install --reinstall python-dnspython

sudo apt autoremove

sudo apt-get -f install

在经历了一整天在互联网最深处的冒险之后,这些命令对我起了作用。

python dnspython和samba在第一个命令之后仍然丢失,--reinstall python-dnspython也将samba引入。Autoremove删除了不必要的依赖项。

你可以通过跑步来恢复一切

sudo apt install gnome

即使你只带着果仁离开

我执行了以下操作,并能够完全恢复系统:

1)sudo apt-get update

2)执行MattSom在上面给出的4个命令(多亏了他):

sudo apt-get install --reinstall python python-chardet python-colorama python-distlib python-django python-django-tables2 python-six python-html5lib python-lxml python-minimal python-pkg-resources python-setuptools python-urllib3 python-requests python-pip python-virtualenv

sudo apt-get install --reinstall python-dnspython

sudo apt autoremove

sudo apt-get -f install

但GUI仍然不可用。我也跑下面去找回它:

3)sudo apt-get install --reinstall ubuntu-desktop

相关问题 更多 >