无法从ppa:cassou / emacs安装Emacs 24

我按照以下说明在我的机器上安装Emacs 24(借鉴: http : //www.mikeyboldt.com/2011/11/30/install-emacs-24-in-ubuntu/ ):

sudo add-apt-repository ppa:cassou/emacs sudo apt-get update sudo apt-get install emacs-snapshot 

但是我收到以下错误:

 Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: emacs-snapshot : Depends: libgnutls26 (>= 2.12.6.1-0) but 2.10.5-1ubuntu3 is to be installed Depends: libmagickcore4 (>= 8:6.6.9.7) but it is not installable Depends: libmagickwand4 (>= 8:6.6.9.7) but it is not installable E: Unable to correct problems, you have held broken packages. 

我昨天也犯了同样的错误。 我尝试在存储库中安装每个emacs包,当这不起作用时,我发现可能存在冲突问题。 因为如果emacs-snapshot可以工作,我不需要emacs23 ,我做了以下事情:

卸载所有Emacs包

在继续之前,通过发出`sudo apt-cache search emacs’来查看可能安装的emacs软件包。 如果您可以牺牲输出中的所有内容,请继续以下建议。

 sudo apt-get remove `apt-cache search emacs | awk '{print $1}'` --purge 

如果你希望保留输出中的其他东西,快速摆脱你不想要的东西是将命令的输出重定向到文件,编辑该文件,然后使用的内容apt-get remove参数的文件。

  1. sudo apt-cache search emacs > remove.txt
  2. 通过删除要保留的包行来编辑remove.txt 。 这里的目标是摆脱与emacs相关的任何东西,所以将这些包留在文件中。
  3. sudo cat remove.txt | xargs apt-get remove --purge

由于emacs-snapshot无法正确安装,因此您可能会遇到一些错误。 如果这样做,请尝试手动卸载这些软件包,方法是首先强制安装损坏的软件包,然后删除它们。

 sudo apt-get -f install # don't list packages here sudo apt-get remove emacs-snapshot --purge 

autocleanautoremove也许是一个好主意。

 sudo apt-get autoclean sudo apt-get autoremove 

安装Emacs 24

 sudo apt-get install emacs-snapshot 

这假设你正确添加了PPA(我也使用了cassou PPA)。 一切似乎现在都很好用!

尝试aptitude

从最初编写这个答案开始,我就开始使用aptitude在命令行上管理我的包。 我不喜欢你从发布sudo aptitude获得的图形界面(ncurses),所以我只在需要通过试验不同的桌面环境来解决依赖性/冲突时才使用它。 大多数时候,我只是将它用作apt-get替代品,就像在sudo aptitude install [package]

相关: aptitude仍然被认为优于apt-get?

我从这个PPA安装了Emacs,我检查了依赖项。 Ubuntu 11.10开箱即用,因此您不会遇到任何问题。 以下是emacs-snapshot的依赖项列表:

 emacs-snapshot-bin-common (= 1:20111227-1~ppa1~oneiric1)libasound2 (>> 1.0.24.1), libc6 (>= 2.11), libcairo2 (>= 1.2.4), libdbus-1-3 (>= 1.1.1), libfontconfig1 (>= 2.8.0), libfreetype6 (>= 2.2.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libgif4 (>= 4.1.4), libglib2.0-0 (>= 2.26.0), libgnutls26 (>= 2.9.11-0), libgpm2 (>= 1.20.4), libgtk-3-0 (>= 3.0.0), libice6 (>= 1:1.0.0), libjpeg62 (>= 6b1), libm17n-0 (>= 1.6.1), libmagickcore3 (>= 8:6.6.0.4), libmagickwand3 (>= 8:6.6.0.4), libncurses5 (>= 5.5-5~), libotf0 (>= 0.9.11), libpng12-0 (>= 1.2.13-4), librsvg2-2 (>= 2.14.4), libselinux1 (>= 1.32), libsm6, libtiff4, libtinfo5 (>= 5.6+20070908), libx11-6, libxft2 (>> 2.1.1), libxml2 (>= 2.7.4), libxpm4, libxrender1 

你的依赖关系中有些东西。 我会禁用PPA,执行apt-get更新并升级然后apt-get clean然后再次重新启用PPA并尝试它。

仅供参考,在Precise Pangolin 12.04上可以简单地完成

 sudo add-apt-repository ppa:cassou/emacs sudo apt-get update sudo apt-get install emacs-snapshot 

它开箱即用。

我认为它可能会有所帮助http://zabambo.com/blog/?p=45

虽然它是24.1,但您可以根据需要更改版本。