我从快照 (emacs-snapshot-common) 安装了 emacs28,但没有意识到它是最新的前沿版本,而不是最新的稳定版本。我尝试从 Kevin Kelly 的 repo 安装 26.3,如所述这里,但出现错误:
Unpacking emacs26-common (26.3~1.git96dd019-kk1+18.04) ...
dpkg: error processing archive /var/cache/apt/archives/emacs26-common_26.3~1.git96dd019-kk1+18.04_all.deb (--unpack):
trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-snapshot-common 20200427:100116-e49d3a4~ubuntu18.04.1
然后我尝试卸载它们两个但得到:
jonathan@DESKTOP-2VSOFC3:~$ sudo apt-get remove emacs-snapshot-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
emacs-snapshot : Depends: emacs-snapshot-common (= 20200427:100116-e49d3a4~ubuntu18.04.1) but it is not going to be installed
emacs26 : Depends: emacs26-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我也尝试过:
sudo dpkg-divert --package emacs26 --divert /usr/include//emacs-module.h.moved --rename /usr/include/emacs-module.h
但这也无济于事……
如果有人能帮我摆脱困境,我将不胜感激。谢谢!
编辑:不知何故,对两个版本再次运行删除都有效,但在尝试安装 emacs-26 时仍然出现相同的错误...而运行“emacs&”返回:
emacs-28.0.50: command not found
所以现在我完全没有可以使用的 emacs 版本 :'(
答案1
如何在 Ubuntu 18.04、16.04、18.10 中安装 GNU Emacs 26.1:
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt install emacs26