你可以找到的描述 去掉 , 的autoremove , 清除 , 清洁 和 自动清洁 ,以及apt-get的联机帮助页的语法: man apt-get
。
如果你在阅读之后仍然不确定(我是),澄清它的最好方法就是尝试一下。
下面是完整依赖关系树的示例 VIM :
你可以得到它:
apt-rdepends -d vim > vim.dot
dotty vim.dot
您还可以使用获取直接依赖项的列表 apt-cache depends
(看到 声明包之间的关系 了解更多信息):
$ apt-cache depends vim
vim
Depends: vim-common
Depends: vim-runtime
Depends: libacl1
Depends: libc6
Depends: libgpm2
Depends: libselinux1
Depends: libtinfo5
Suggests: <ctags>
exuberant-ctags
Suggests: vim-doc
Suggests: vim-scripts
所以它看起来像 VIM 取决于许多软件包,让我们尝试安装它 apt-get install
看看会发生什么:
$ sudo apt-get install vim
...
The following extra packages will be installed:
vim-common vim-runtime
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim vim-common vim-runtime
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
After this operation, 25.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? n
为了得到 VIM 我们需要工作 VIM常见 和 VIM运行时 包和 apt-get
会照顾它。我们可以验证它 dpkg -s pkg...
(看到 man dpkg
有关状态的更多信息):
$ sudo dpkg -s libc6
Package: libc6
Status: install ok installed // we already have it, no need to install
$ sudo dpkg -s vim-common
Package: vim-common
Status: deinstall ok config-files // we don't have it, have to install
正如我们检查了什么 VIM 取决于,我们还可以检查其他东西依赖于相同的包 VIM 运用 apt-cache rdepends
。我们应该看到 VIM 其中(可能)其他事情:
$ apt-cache rdepends vim-common
vim-common
Reverse Depends:
vim-latexsuite
vim-addon-manager
vim-tiny
vim-nox
vim-gtk
vim-gnome
|vim-dbg
vim-athena
vim // there it is
让我们继续安装。一旦我们安装完毕 VIM 我们可以体验到之间的区别 去掉 和 的autoremove 。让我们尝试 去掉 第一:
$ sudo apt-get remove vim
...
The following packages will be REMOVED:
vim
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1,922 kB disk space will be freed.
Do you want to continue [Y/n]? n
apt-get remove
然后会删除 VIM 但 不是它的依赖性让它们落后 。我们现在尝试删除其中一个 VIM 依赖:
$ sudo apt-get remove vim-runtime
...
The following packages will be REMOVED:
vim vim-runtime
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 24.8 MB disk space will be freed.
Do you want to continue [Y/n]? n
这将消除依赖性 VIM运行时 以及依赖它的包装 ,即 VIM 。出于好奇,让我们看看如果我们删除了较低的依赖项会发生什么 VIM 的依赖树:
$ sudo apt-get remove libgpm2
...
The following packages were automatically installed and are no longer required:
libgtkglext1 libqtassistantclient4 libtiff-tools libtiff5 python-qt4
python-sip python-sqlalchemy python-sqlalchemy-ext
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
anki cheese gimp gimp-gmic gimp-plugin-registry gnome-control-center // !
gnome-media gnome-video-effects gstreamer0.10-plugins-good libaa1 // !
libcheese-gtk21 libcheese3 libgpm2 mplayer quodlibet vim vlc w3m // !
0 upgraded, 0 newly installed, 18 to remove and 0 not upgraded.
After this operation, 63.1 MB disk space will be freed.
Do you want to continue [Y/n]? n
它会删除vim和许多好东西!
我们继续吧 apt-get remove vim
然后。一旦我们完成它,我们应该有一些剩菜。如果我们现在尝试 的autoremove 我们可以看到:
$ sudo apt-get autoremove
...
The following packages will be REMOVED:
vim-common vim-runtime
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 23.2 MB disk space will be freed.
Do you want to continue [Y/n]? y
这是两个包 apt-get remove
即使没有别的东西需要它
用apt-get 0.9.7.9进行实验。
apt-get remove libreoffice