70

I use Ubuntu 12.04 64-bit, I did the following: sudo gedit /etc/apt/apt.conf and added

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

But it did not work. When I try to install a package, it still wants to install the suggested and recommended packages. How can I solve this?

  • See this related question: askubuntu.com/questions/196059/… – user76204 Oct 24 '12 at 11:10
  • 3
    apt-config dump |fgrep -i recommend will suggest current fashion syntax in case it changes again. – temoto Feb 20 '15 at 15:02
86

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.

|improve this answer|||||
  • This will work, i can confirm that. – Thomas Ward Aug 22 '12 at 17:46
  • I have already tried that option but I'm trying to install from a ppa and not work, if it has worked installing from ubuntu reposoritorio. – user84911 Aug 22 '12 at 20:47
  • I want to configure apt-get to always, do not install the packages suggested and recommended, so I want to set the file apt.conf sorry for my bad english – user84911 Aug 22 '12 at 20:48
  • Edited post to show what apt.conf should have. – Alex L. Aug 22 '12 at 21:46
  • 2
    Reading the packaging documentation I understand that 'recommended' packages should probably be installed. Can you explain why you don't recommend disabling the installation of 'suggested' packages? They seem rather annoying to me so far. – jlh Feb 17 '16 at 21:14
20

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.

|improve this answer|||||
13

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";
|improve this answer|||||
  • 2
    The question is about 12.04. The answer from lan already mentions for later versions it is APT::Install-Recommends so your answer does not add additional information. – Requist Jan 7 '15 at 19:43
  • 3
    You should tell which OS version did you try it with rather than the calendar date. – Melebius Jun 30 '15 at 9:47
12

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.

|improve this answer|||||
  • How so? What's the reasoning? – outlyer Apr 27 '19 at 7:49
4

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.

|improve this answer|||||
2

You can specify configuration strings from the command line, using the -o option.

This works for me (APT v.1.4.8) (sudo as needed):

apt-get install package1 package2 -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
|improve this answer|||||
  • 1
    This works for apt-get. But what should I do for apt? – Rolf Feb 8 '18 at 16:15
1

I would recommend creating /etc/apt/apt.conf.d/60user file with the single line:

APT::Install-Recommends "false";

This works fine for me on 12.04.

|improve this answer|||||
  • 2
    OP already stated that this did not work. – Oli Oct 24 '12 at 10:24
  • I checked this on 10.04, 12.04, 14.04 and APT::GET::* dont work, buy APT::Install-* did work well with "apt-get install" – ggrandes Jul 11 '14 at 9:19
0

Use the following command to add it to /etc/apt/apt.conf.d/99norecommend:

apt-config dump | grep -we Recommends -e Suggests | sed s/1/0/ | sudo tee /etc/apt/apt.conf.d/99norecommend

Check the current settings by:

apt-config dump | grep -we Recommends -e Suggests

See: Can I make apt-get always use --no-install-recommends?

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.