How to not install recommended and suggested packages?

Solution 1:

If you do not want to install recomended packages you can run apt-get with the --no-install-recommends flag or aptitude with the --without-recommends/-R flag.


If you want these flags to always be enabled (I do NOT recommend this) put the following lines in your /etc/apt/apt.conf file:

APT::Get::Install-Recommends "false";
APT::Get::Install-Suggests "false";

Remember that these packages are recommended for a reason and it is probably not a good idea to ignore it at all times. You would be better off using the flags in the cases where you know that the recommended packages are wrong.

Solution 2:

The correct syntax in recent versions appears to be:

APT::Install-Suggests "0";
APT::Install-Recommends "0";

You can put this in /etc/apt/apt.conf (which no longer exists by default) or in a file such as 99local in /etc/apt/apt.conf.d.

Watch out for any other files in /etc/apt/apt.conf.d which may override your settings.

Solution 3:

According to me, changing conf files are too risky and unnecessary. Rather apt-get provides options to specify do not install recommended packages.

sudo apt-get install --no-install-recommends package-name

This is better than changing conf file.

Solution 4:

Checked today (07 Jan 2015).

These settings work well for me:

APT::Install-Recommends "false";
APT::Install-Suggests "false";

This solution does not work:

APT::Get::Install-Recommends "false";
APT::Get::Install-Suggests "false";

Solution 5:

You might be like me and have an /etc/apt/apt.conf.d/99synaptic file lurking around. I'm still not entirely sure where this file came from but it contains one line:

APT::Install-Recommends "true";

That would certainly have overridden a change in /etc/apt/apt.conf. I can't see that the file is used by any package any longer so I would suggest just deleting it (check the contents are similar) or swapping true for false.