manually download the python2.7 package (and its dependencies), and manually install them using dpkg (bypassing apt, which requires Python). Once that's installed, apt should work again, and so apt-get install ubuntu-desktop will restore your system.
Open a text-only virtual console by pressing the keyboard shortcut Ctrl + Alt + F3.
At the login: prompt type your username and press Enter.
At the Password: prompt type your user password and press Enter.
发生什么事了
哎呀!似乎Ubuntu的许多重要包和部分都需要python来运行(包括
apt
本身)。这是你应该尽量避免的糟糕情况之一通过调用
autoremove
,python包连同它现在不需要的所有依赖项一起被卸载。但是,需要python工作的包现在被挂起了。 (更多关于what autoremove does.)就好像你把一棵树的根砍掉-树还会在那里,但是没有它的根,它就不会是一棵非常有效的树
您可以check the apt-get log查看受影响的内容
我该怎么修
首先,将所有重要文件复制到外部备份位置(如果在此之前您一直保持定期、最新的备份,请给自己打5分)
在你的文件安全之后,你似乎有两个选择
1.简单方法
重新安装Ubuntu是最简单的方法。使用python和所有其他重要的东西,您将恢复到工作配置
2.艰难的道路
下面是一些其他的答案,详细说明了如何重新安装已删除的软件包,如果您想尝试手动修复此问题,而不必从头开始。这样做的主要问题是,如果没有python,
apt
将无法工作,因此在重新安装ubuntu-desktop
之前,需要使用其他工具来重新安装python
相关问题 更多 >
编程相关推荐