我正在使用 LXDE,当我安装时gnome-screensaver
,它有很多依赖项,包括pulseaudio
.然后我立即卸载了它autoremove
(没有中间步骤),但没有删除任何依赖项。这是为什么?
这是我的/var/log/apt/history.log
:
Start-Date: 2014-07-05 18:49:28
Commandline: apt-get install gnome-screensaver
Install: gnome-sushi:amd64 (0.4.1-3, automatic), python-packagekit:amd64 (0.7.6-3, automatic), gnome-power-manager:amd64 (3.4.0-2, automatic), libcogl9:amd64 (1.10.2-7, automatic), python-aptdaemon.pkcompat:amd64 (0.45-2, automatic), libgtksourceview-3.0-0:amd64 (3.4.2-1, automatic), libao-common:amd64 (1.1.0-2, automatic), libcogl-pango0:amd64 (1.10.2-7, automatic), nautilus:amd64 (3.4.2-1+build1, automatic), libgmime-2.6-0:amd64 (2.6.10-1, automatic), libgnome-desktop-3-2:amd64 (3.4.2-1, automatic), gnome-session-bin:amd64 (3.4.2.1-4, automatic), gir1.2-clutter-gst-1.0:amd64 (1.5.4-1+build0, automatic), pulseaudio:amd64 (2.0-6.1, automatic), gnome-settings-daemon:amd64 (3.4.2+git20121218.7c1322-3+deb7u3, automatic), gir1.2-json-1.0:amd64 (0.14.2-1, automatic), libburn4:amd64 (1.2.2-2, automatic), pulseaudio-module-x11:amd64 (2.0-6.1, automatic), libmozjs185-1.0:amd64 (1.8.5-1.0.0+dfsg-4, automatic), gnome-desktop3-data:amd64 (3.4.2-1, automatic), gir1.2-coglpango-1.0:amd64 (1.10.2-7, automatic), libexempi3:amd64 (2.2.0-1, automatic), libclutter-1.0-common:amd64 (1.10.8-2, automatic), gir1.2-gtksource-3.0:amd64 (3.4.2-1, automatic), libgtksourceview-3.0-common:amd64 (3.4.2-1, automatic), libclutter-1.0-0:amd64 (1.10.8-2, automatic), libao4:amd64 (1.1.0-2, automatic), libgnomekbd7:amd64 (3.4.0.2-1, automatic), nautilus-data:amd64 (3.4.2-1+build1, automatic), cdrdao:amd64 (1.2.3-0.3, automatic), libtotem-plparser17:amd64 (3.4.2-1, automatic), libquvi7:amd64 (0.4.1-1, automatic), libwacom2:amd64 (0.6-1, automatic), gnome-screensaver:amd64 (3.4.1-1), libpackagekit-glib2-14:amd64 (0.7.6-3, automatic), brasero-common:amd64 (3.4.1-4, automatic), libclutter-gst-1.0-0:amd64 (1.5.4-1+build0, automatic), libquvi-scripts:amd64 (0.4.21-1~deb7u1, automatic), brasero:amd64 (3.4.1-4, automatic), libwacom-common:amd64 (0.6-1, automatic), libmusicbrainz5-0:amd64 (5.0.1-2, automatic), libjte1:amd64 (1.19-1, automatic), libisofs6:amd64 (1.2.2-1, automatic), libtracker-sparql-0.14-0:amd64 (0.14.1-3, automatic), libjson-glib-1.0-0:amd64 (0.14.2-1, automatic), libcogl-common:amd64 (1.10.2-7, automatic), gir1.2-evince-3.0:amd64 (3.4.0-3.1, automatic), libgjs0b:amd64 (1.32.0-5, automatic), libbrasero-media3-1:amd64 (3.4.1-4, automatic), gir1.2-cogl-1.0:amd64 (1.10.2-7, automatic), libclutter-gtk-1.0-0:amd64 (1.2.0-2, automatic), gir1.2-clutter-1.0:amd64 (1.10.8-2, automatic), hwdata:amd64 (0.234-1, automatic), gir1.2-gtkclutter-1.0:amd64 (1.2.0-2, automatic), libgnomekbd-common:amd64 (3.4.0.2-1, automatic)
End-Date: 2014-07-05 18:49:45
Start-Date: 2014-07-05 18:49:59
Commandline: apt-get autoremove gnome-screensaver
Remove: gnome-screensaver:amd64 (3.4.1-1)
End-Date: 2014-07-05 18:50:01
答案1
如果任何依赖项有一些其他先前安装的软件包推荐/建议它们,那么 apt 不会删除它们。
您应该已经安装了另一个建议或推荐该软件包的软件包。如果您检查apt-cache rdepends pulseaudio
推荐/建议pulseaudio的软件包,那就是原因。
我通常不使用,autoremove
因为我更喜欢实际键入我想要删除的软件包,但在您的情况下,您应该能够实现您想要的目标,具体指定您想要卸载的所有软件包,而正常情况下autoremove
不会:
sudo apt-get autoremove <Z> <dependency of Z>
这样您就可以确保您的包裹被删除。
您还可以使用 deborphan 来删除一些依赖项,但我怀疑它是否会在这种特定情况下有所帮助。