Installing suggested/recommended packages?

Solution 1:

Recommends are installed by default (since Lucid). To negate this for a specific package, use apt-get --no-install-recommends install pkg. Suggests, however, are not. You can install the suggests for a single package installation by using apt-get -o APT::Install-Suggests="true" install pkg.

Installing conky without Suggests:

laney@iota> sudo apt-get install conky
[...]
Suggested packages:
  apcupsd moc mpd
The following NEW packages will be installed
  conky conky-all

…or with Suggests:

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

You can make this the default behaviour by putting

APT::Install-Suggests "true"

in a file in /etc/apt/apt.conf.d/, for example /etc/apt/apt.conf.d/30install-suggests.

Solution 2:

For the suggested packages, you can simply use the --install-suggests flag:

Consider suggested packages as a dependency for installing.
Configuration Item: APT::Install-Suggests.

instead of passing the option -o APT::Install-Suggests="true"
[ just like you have --install-recommends ]

Example:

sudo apt-get --install-suggests install mercurial

Solution 3:

Add the option --install-recommends to your command:

sudo apt-get --install-recommends install virtualbox-4.0