apt-get purge 未完全卸载

apt-get purge 未完全卸载

我已经安装了 emacs 和apt-get.我稍后尝试将其删除,但二进制文件仍然存在。

root@ionian:/home/gauthier# apt-get --purge remove emacs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'emacs' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ionian:/home/gauthier# which emacs
/usr/bin/emacs
root@ionian:/home/gauthier# 

(上面显示的清除不是第一次尝试,这只是为了表明该包已经被删除。)

我之前没有安装 emacs apt-get install emacs

知道发生了什么事吗?为什么 apt-get 看不到二进制文件,为什么它认为 emacs 已经被卸载?完全卸载 emacs 的干净方法是什么?

答案1

删除“emacs”不会清除,/usr/bin/emacs因为后者不是由“emacs”包提供的。

在 Debian 上,有不同风格的 emacs,因此/usr/bin/emacs默认使用指向特定可执行文件的符号链接。您可以通过运行命令来选择要使用的应用程序:

sudo update-alternatives --config emacs

另外,包“galternatives”提供了很好的 GUI 应用程序来管理替代方案。

如果您运行,aptitude show emacs您可能会看到“emacs”是一个元包,它仅依赖于一些提供 emacs 可执行文件的其他包。当您清除“emacs”时,它已完全卸载,但其依赖包可能仍然存在于您的系统上。您可以使用以下命令删除它们

sudo apt-get autoremove

或者如果您使用aptitude它,它会自动建议删除自动安装的软件包。

要摆脱它,/usr/bin/emacs您必须卸载所有 emacs 替代品,例如“emacs23”或“emacs24”或任何“emacs-*”软件包。

运行以下命令来查找哪些可执行文件可用作 emacs 替代品

update-alternatives --list emacs

此外,您可能会发现dlocate实用程序对于查找哪个包提供特定文件很有用。

阅读有关替代方案的更多信息

答案2

emacs23您和朋友可能仍然安装了。

sudo apt-get remove emacs*

相关内容