Answers:
它们是否应该同时存在也许是一个辩论点。
但是-它们是完全相同的。
从手册页 apt-get
- 清除 使用清除而不是删除来删除将要删除的任何内容。一个 星号(“ *”)将显示在 预定要清除。remove --purge等同于清除 命令。配置项:APT :: Get :: Purge。
它们的关键部分是--purge等效于purge命令
至于原因-我想这是历史性的-
apt-get --purge remove
来过 apt-get purge
查看旧的apt文档,它会参考该命令的旧版本。在新文档给出了aptitude
与apt-get purge
实例。
为了保持一致性-不删除旧界面是一个好主意-如果您使用的是旧脚本-由于界面命令仍然存在,因此它今天仍然可以使用。
请注意,这不会阻止Gnome弃用api-但这是另一个故事...
apt-get autoremove
。
据我所知,它们并没有完全相同的作用,删除软件包并尝试删除由这些软件包创建的任何配置文件。
基本上apt-get purge
是在此之后实施的,apt-get remove --purge
但仍然保留了旧选项样式的清除。
它们与官方手册页中所说的相同:remove --purge is equivalent to the purge command.
请参阅man apt
和在线Ubuntu手册页。我认为用法得到了发展,两个命令仍然存在;正如其他程序中发生的那样,用法发生了变化,一种形式(即sudo apt-get purge
)成为了另一种形式的首选。但是,尽管Debian Handbook中有关于软件包管理的有用章节以及Raphael Hertzog博客中关于apt-get的文章,但我仍在寻找参考并研究其使用历史。。
使用删除vlc的示例(尽管带有Simulation -s
标志),我们可以看到这些命令具有相同的结果。vlc使用的所有其他文件都需要删除sudo apt-get autoremove
两种情况下都。
1) sudo apt-get remove --purge
sudo apt-get -s remove --purge vlc
[sudo] password for mike:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libdc1394-22 libxcb-keysyms1 libzvbi0 libxcb-xv0 libtar0 libass4 libdvbpsi7
libvlc5 vlc-nox libupnp3 libzvbi-common libxcb-randr0 libxcb-composite0
libiso9660-8 libkate1 vlc-plugin-notify vlc-plugin-pulse vlc-data
libdirac-encoder0 libvlccore5 libvcdinfo0 libebml3 libmatroska5
libsdl-image1.2
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED
vlc*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Purg vlc [2.0.3-0ubuntu0.12.04.1]
2) sudo apt-get purge
sudo apt-get -s purge vlc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libdc1394-22 libxcb-keysyms1 libzvbi0 libxcb-xv0 libtar0 libass4 libdvbpsi7
libvlc5 vlc-nox libupnp3 libzvbi-common libxcb-randr0 libxcb-composite0
libiso9660-8 libkate1 vlc-plugin-notify vlc-plugin-pulse vlc-data
libdirac-encoder0 libvlccore5 libvcdinfo0 libebml3 libmatroska5
libsdl-image1.2
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED
vlc*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Purg vlc [2.0.3-0ubuntu0.12.04.1]
--purge
使用该autoremove
命令时,该开关会派上用场。我知道没有其他方法可以apt-get
删除要自动删除的软件包的配置文件。