关于 apt-get 和默认安装推荐的元讨论

关于 apt-get 和默认安装推荐的元讨论

我注意到,当我尝试在 xubuntu 12.04 中安装 rhythmbox 时,它似乎依赖于 gnome 桌面和 nautilus,而这两者都不是我想要的。

sudo apt-get install rhythmbox
[sudo] password for mark: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gir1.2-gst-plugins-base-0.10 gir1.2-gstreamer-0.10 gir1.2-peas-1.0
  gir1.2-rb-3.0 gnome-desktop3-data libdiscid0 libdmapsharing-3.0-2 libexempi3
  libgnome-desktop-3-2 libmusicbrainz3-6 libpeas-1.0-0 libpeas-common
  librhythmbox-core5 nautilus nautilus-sendto python-mako python-markupsafe
  rhythmbox-data rhythmbox-mozilla rhythmbox-plugin-cdrecorder
  rhythmbox-plugin-zeitgeist rhythmbox-plugins
Suggested packages:
  eog gnome-sushi pidgin gajim python-beaker python-mako-doc
  gnome-control-center
The following NEW packages will be installed
  gir1.2-gst-plugins-base-0.10 gir1.2-gstreamer-0.10 gir1.2-peas-1.0
  gir1.2-rb-3.0 gnome-desktop3-data libdiscid0 libdmapsharing-3.0-2 libexempi3
  libgnome-desktop-3-2 libmusicbrainz3-6 libpeas-1.0-0 libpeas-common
  librhythmbox-core5 nautilus nautilus-sendto python-mako python-markupsafe
  rhythmbox rhythmbox-data rhythmbox-mozilla rhythmbox-plugin-cdrecorder
  rhythmbox-plugin-zeitgeist rhythmbox-plugins
0 upgraded, 23 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,688 kB of archives.
After this operation, 15.0 MB of additional disk space will be used.

答案1

您不必安装所有推荐的软件包 - 这些额外的软件包具有 gnome 和 nautilus 依赖性。

下面模拟在xubuntu 12.04上的安装NB-s是模拟参数。

sudo apt-get -s --no-install-recommends install rhythmbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gir1.2-gst-plugins-base-0.10 gir1.2-gstreamer-0.10 gir1.2-rb-3.0 libdiscid0 libgmime-2.6-0 libmusicbrainz3-6 libneon27-gnutls libpeas-1.0-0 libpeas-common
  libquvi-scripts libquvi7 librhythmbox-core5 libtotem-plparser17 media-player-info rhythmbox-data
Suggested packages:
  gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gnome-control-center
Recommended packages:
  rhythmbox-mozilla rhythmbox-plugin-cdrecorder rhythmbox-plugin-zeitgeist rhythmbox-plugins
The following NEW packages will be installed
  gir1.2-gst-plugins-base-0.10 gir1.2-gstreamer-0.10 gir1.2-rb-3.0 libdiscid0 libgmime-2.6-0 libmusicbrainz3-6 libneon27-gnutls libpeas-1.0-0 libpeas-common
  libquvi-scripts libquvi7 librhythmbox-core5 libtotem-plparser17 media-player-info rhythmbox rhythmbox-data

--no-install-recommends正如您上面所看到的,使用作为参数删除推荐的软件包会删除 gnome 和 nautilus 软件包。

因此 - 安装 rhythmbox 及其插件(不含 gnome 和 nautilus):

sudo apt-get --no-install-recommends install rhythmbox rhythmbox-plugins

答案2

简短的回答是,您可以安装没有这些依赖项的 RhythmBox - 请参阅上面@fossfreedom 的回答,但这是一种有点迂回的方式。

好消息是,这libgnome-desktop不是gnome-desktop,也不会将您的 XFCE/Xubuntu 更改为常规 Ubuntu。至于nautilus,它可能会用于 Rhythmbox 的某些功能(可能与文件管理有关);它不会取代 Thunar 作为您的默认文件管理器,尽管如果您出于某种原因想要运行 Nautilus,您可能会这样做。


关于 apt-get 和默认安装推荐的元讨论

apt-get在 Ubuntu 上,默认情况下会安装推荐的软件包。此行为似乎是从 Debian 5(Lenny)开始继承的——Ubuntu Lucid 也是如此;在 Debian Lenny 之前,它被禁用了。一些开发人员会在可能不需要时滥用或盲目地设置推荐,但这可能是出于某种原因而默认的。

您可以通过运行以下命令来检查其状态:

sudo apt-config dump | grep Recommends

如果它返回APT::Install-Recommends "1";(或为真),则您的设置将安装推荐的版本。

您可以通过安装 Synaptic、转到“编辑...首选项”并取消选中“将推荐的软件包视为依赖项”来以图形方式更改此设置。但如果你已经读到这里,那么输入会更容易APT::Install-Recommends "0";; /etc/apt/apt.conf)

最好的选择是按照@fossfreedom 的回答所建议的那样,根据具体情况进行处理。

相关内容