尝试升级 Python。掉进兔子洞。最后弄坏了肉桂。回来了,但处境很危险

尝试升级 Python。掉进兔子洞。最后弄坏了肉桂。回来了,但处境很危险

我的情况是:我刚刚通过全新安装和恢复修复了 Ubuntu 14.04。此时,我已经在 Ubuntu 14.04 上从源代码安装了 python 2.7.10。我在安装过程中将其设置为主要 python 程序。到目前为止,在修复了一些错误并临时处理了一些与登录时获取的文件相关的内容后,它按预期运行。我刚刚尝试清理我的文件系统,但 apt 发出了抱怨。

$ sudo apt-get autoremove

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:
 apt-xapian-index : Depends: python:any (>= 2.7.1-0ubuntu2)
 caribou : Depends: python:any (>= 2.7.1-0ubuntu2)
 duplicity : Depends: python:any (>= 2.7.1-0ubuntu2)
 gconf2 : Depends: python:any
 gimp : Depends: python:any (>= 2.7.1-0ubuntu2)
 mintstick : Depends: python:any (>= 2.7.1-0ubuntu2)
 mintupdate : Depends: python:any (>= 2.7.5-5~)
 nemo-emblems : Depends: python:any (>= 2.7~)
                Depends: python:any (< 2.8)
...

E: Unmet dependencies. Try using -f

于是我尝试了一下。

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libpython2.7 libpython2.7-minimal libpython2.7-stdlib libsmbclient
  libutempter0 python2.7 python2.7-minimal samba-common samba-dsdb-modules
  samba-libs samba-vfs-modules smbclient xterm
Suggested packages:
  python2.7-doc heimdal-clients xfonts-cyrillic
The following packages will be REMOVED:
  apt-xapian-index apturl apturl-common caribou cinnamon cinnamon-bluetooth
  cinnamon-control-center cinnamon-desktop-data cinnamon-screensaver
  cinnamon-session cinnamon-settings-daemon duplicity gconf2 gdebi gedit gimp
...
The following NEW packages will be installed:
  libutempter0 xterm
The following packages will be upgraded:
  libpython2.7 libpython2.7-minimal libpython2.7-stdlib libsmbclient python2.7
  python2.7-minimal samba-common samba-dsdb-modules samba-libs
  samba-vfs-modules smbclient
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  mintsources python-gtk2 (due to mintsources) python-glade2 (due to
  mintsources) python-pycurl (due to mintsources)
11 upgraded, 2 newly installed, 152 to remove and 168 not upgraded.
Need to get 10.2 MB of archives.
After this operation, 203 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] Abort.

因此我无法修复损坏的软件包,因为 apt 似乎会删除我喜欢的许多东西,例如 cinnamon 和 gnome-terminal。未满足的依赖项的共同主题是它们需要 python >=2.7.1。我有来自存储库的 python 2.7.6 和来自源代码的 python 2.7.10。我该如何修复损坏的软件包并满足未满足的依赖项,同时又不破坏我的桌面环境?

答案1

有一个提供此版本的 ppa:

sudo add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall python python2.7

点击这里查看更多信息

另外,看看这个类似的问题了解如何与 apt-get 版本并排安装编译版本,以避免通过保留已安装的 apt-get 版本而出现依赖性问题。

相关内容