我按照以下说明在我的机器上安装 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
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
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.
Run Code Online (Sandbox Code Playgroud)
小智 5
我昨天有同样的错误。我尝试在存储库中安装每个 emacs 包,但当这不起作用时,我突然想到可能是冲突造成了问题。由于我不需要emacs23
ifemacs-snapshot
会起作用,因此我执行了以下操作:
在继续之前,通过发出“sudo apt-cache search emacs”来查看可能安装了哪些 emacs 包。如果您可以牺牲输出中的所有内容,请继续执行以下建议。
sudo apt-get remove `apt-cache search emacs | awk '{print $1}'` --purge
Run Code Online (Sandbox Code Playgroud)
如果输出中出现了您希望保留的其他内容,摆脱不想要的内容的一种快速方法是将命令的输出重定向到一个文件,编辑该文件,然后使用该文件的参数为apt-get remove
.
sudo apt-cache search emacs > remove.txt
remove.txt
通过删除要保留的包行进行编辑。这里的目标是摆脱任何与 emacs 相关的东西,所以将这些包留在文件中。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
Run Code Online (Sandbox Code Playgroud)
这可能也是一个好主意,autoclean
和autoremove
。
sudo apt-get autoclean
sudo apt-get autoremove
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install emacs-snapshot
Run Code Online (Sandbox Code Playgroud)
这假设您已正确添加 PPA(我也在使用 cassou PPA)。现在一切似乎都运行良好!
aptitude
自从最初写这个答案以来,我已经开始使用aptitude
在命令行上管理我的包。我不喜欢您从发布中获得的图形界面 (ncurses) sudo aptitude
,因此我仅在需要解决因尝试不同的桌面环境而遗留的依赖项/冲突时才使用它。大多数时候,我只是把它作为一个下拉更换apt-get
,如sudo aptitude install [package]
。
相关:aptitude 仍然被认为优于 apt-get 吗?
小智 2
我从这个 PPA 安装了 Emacs,并检查了依赖关系。Ubuntu 11.10 可以开箱即用地使用此 PPA,因此您应该不会遇到任何问题。以下是 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
Run Code Online (Sandbox Code Playgroud)
你的依赖中有一些东西是混乱的。我会禁用 PPA,执行 apt-get update 和升级,然后 apt-get clean,然后再次重新启用 PPA 并尝试。