不小心apt-get remove python后如何恢复 [英] How to restore after accidentally apt-get remove python

查看:57
本文介绍了不小心apt-get remove python后如何恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的.我已经这样做了.太蠢了.

Yeah. I've done this. It was stupid.

我不知道它会带走自己的依赖,只想从头开始安装 python 2 和 3(因为这个问题:https://askubuntu.com/questions/897355/how-to-change-default-idle-for-python).

I did not know it's going to take its dependencies with itself, only wanted to install python 2 and 3 from scratch (because of this problem: https://askubuntu.com/questions/897355/how-to-change-default-idle-for-python).

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

Now, I can still use my terminal, checked these answers:

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 后,我收到以下错误:

However after running sudo apt-get install ubuntu-desktop I get these errors:

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 命令都会抛出这个.

Every apt-get install command throws this.

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

Is there a way to restore these dependencies?

推荐答案

哈利路亚.

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

在互联网最深的坑里冒险了一整天后,这些命令对我有用.

After a whole day of adventures in the deepest pits of internet, these commands worked for me.

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

python-dnspython and samba was still missing after the first command, --reinstall python-dnspython pulled samba in as well. Autoremove removed the needless dependencies.

当然,其中一些可能是多余的,但我只是在关注一些长期丢失的论坛帖子,重要的是它有效.

Naturally some of these could be quite redundant but I was just following some long lost forum posts all over the place and what matters is that it worked.

这篇关于不小心apt-get remove python后如何恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆