首页 > 解决方案 > 如何删除emacs full?

问题描述

我在我的 Ubuntu 中安装了 Emacs,但我无法卸载(也无法再安装任何东西)

▶ sudo apt-get install tig
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-bin-common : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
 emacs-el : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
 emacs-gtk : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我尝试运行命令apt --fix-broken install,但收到以下错误消息:

▶ sudo apt --fix-broken install -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  emacs-common
Suggested packages:
  emacs-common-non-dfsg ncurses-term
The following NEW packages will be installed:
  emacs-common
0 upgraded, 1 newly installed, 0 to remove and 133 not upgraded.
3 not fully installed or removed.
Need to get 0 B/13,3 MB of archives.
After this operation, 68,4 MB of additional disk space will be used.
(Reading database ... 185527 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb ...
Unpacking emacs-common (1:26.1+1-3.2ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb (--unpack):
 trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs26-common 26.2~1.gitfd1b34b-kk1+19.04
Errors were encountered while processing:
 /var/cache/apt/archives/emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该怎么做才能解决这个问题?

谢谢

标签: emacsuninstallationapt-get

解决方案


尝试删除缺少依赖项的损坏包,例如

sudo apt remove --purge emacs-bin-common emacs-el emacs-gtk

如果这不起作用,请添加 --force 标志再试一次。

您最初是如何尝试卸载 emacs 的?


推荐阅读