安装建议/推荐的软件包?

myu*_*uf3 43 apt

我运行了下面的代码,得到这个包需要这些包,现在它也说这些包是建议的,这些是推荐的。我该如何安装它们。

myusuf3@purple:/etc$ sudo apt-get install virtualbox-4.0 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  acroread ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32v4l-0 lib32z1 libaudio2
  libc6-i386 libcurl3 libflac8 libhal1 liblcms1 libmng1 libogg0 libpulse0 libqt4-dbus libqt4-network libqt4-opengl
  libqt4-xml libqtcore4 libqtgui4 libsdl-ttf2.0-0 libsdl1.2debian libsdl1.2debian-alsa libsndfile1 libv4l-0
  libvorbis0a libvorbisenc2 libx11-xcb1 nspluginwrapper
Suggested packages:
  libldap2 libgnome-speech7 lib32asound2-plugins nas liblcms-utils pulseaudio qt4-qtconfig
Recommended packages:
  pdf-viewer
The following NEW packages will be installed:
  acroread ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32v4l-0 lib32z1 libaudio2
  libc6-i386 libcurl3 libflac8 libhal1 liblcms1 libmng1 libogg0 libpulse0 libqt4-dbus libqt4-network libqt4-opengl
  libqt4-xml libqtcore4 libqtgui4 libsdl-ttf2.0-0 libsdl1.2debian libsdl1.2debian-alsa libsndfile1 libv4l-0
  libvorbis0a libvorbisenc2 libx11-xcb1 nspluginwrapper virtualbox-4.0
0 upgraded, 34 newly installed, 0 to remove and 26 not upgraded.
Need to get 168MB of archives.
After this operation, 460MB of additional disk space will be used.
Run Code Online (Sandbox Code Playgroud)

谢谢,麻烦您了

Iai*_*ane 45

推荐是默认安装的(自 Lucid 起)。要为特定包否定这一点,请使用apt-get --no-install-recommends install pkg. 然而,建议并非如此。您可以使用apt-get -o APT::Install-Suggests="true" install pkg.

在没有建议的情况下安装 conky:

laney@iota> sudo apt-get install conky
[...]
Suggested packages:
  apcupsd moc mpd
The following NEW packages will be installed
  conky conky-all
Run Code Online (Sandbox Code Playgroud)

……或建议:

laney@iota> sudo apt-get -o APT::Install-Suggests="true" install conky
[...]
The following NEW packages will be installed
  apache2 apache2-doc apache2-mpm-worker apache2-suexec apache2-utils apache2.2-bin apache2.2-common apcupsd apcupsd-cgi apcupsd-doc ario ario-common conky
  conky-all icecast2 ices2 libao-common libao4 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcue1 libmpdclient2 libresid-builder0c2a libsidplay2 libsidutils0
  moc moc-ffmpeg-plugin mpd
Run Code Online (Sandbox Code Playgroud)

您可以通过将其设为默认行为

APT::Install-Suggests "true"
Run Code Online (Sandbox Code Playgroud)

在一个文件中/etc/apt/apt.conf.d/,例如/etc/apt/apt.conf.d/30install-suggests

  • 也可以使用 `--install-suggests` 选项安装建议的软件包。例如`sudo apt install --install-suggests conky` (7认同)

Mar*_*tuc 33

对于建议的包,您可以简单地使用--install-suggests标志:

将建议的软件包视为安装的依赖项。
配置项:APT::Install-Suggests。

而不是传递选项-o APT::Install-Suggests="true"
[ 就像你一样--install-recommends]

例子:

sudo apt-get --install-suggests install mercurial
Run Code Online (Sandbox Code Playgroud)

  • 那个命令不是递归的吗?因此,您还将安装所有建议包的建议包等等。我见过 3rd 方的例子,其中几 MB 的初始安装量已经超过 1GB 的安装量,因为这条路线可能会引发递归。 (7认同)
  • @PhillHealey 是的,那是我会避免使用 `--install-suggests` 的地方,所以它只适用于交互式安装。(而且我真的很想知道为什么有人需要*所有**自动脚本*中的建议软件……据我所知,建议的软件就像“买了这件商品的客户也买了”;我必须非常富有才能要求一个“购买所有”功能甚至无需查看列表。) (3认同)

Isa*_*iah 12

将选项添加--install-recommends到您的命令中:

sudo apt-get --install-recommends install virtualbox-4.0 
Run Code Online (Sandbox Code Playgroud)

  • 那个命令不是递归的吗?因此,您还将安装所有建议包的建议包等等。我见过 3rd 方的例子,其中几 MB 的初始安装量已经超过 1GB 的安装量,因为这条路线可能会引发递归。 (2认同)