Install recommended packages to avoid problems

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Install recommended packages to avoid problems

Post by xenopeek »

Many a user here on the forum can be found having trouble with installing programs on Linux Mint, because recommended packages are not automatically installed. Ubuntu on the other hand automatically installs recommended packages. Using a guide or tutorial for Ubuntu will thus not give you the desired outcome. Sometimes it may be just that some add-ons for the program aren't installed, limiting functionality but leaving the program otherwise working. However, I've helped quite a lot of people both here and on IRC that were left with completely non-functioning programs because recommended packages weren't installed.

If you don't mind using a few extra megabytes when installing a program (both in download and in hard disk usage) you can change the default behavior back to how Ubuntu handles this--automatically installing recommended packages when installing a program, giving you the best experience with the program with all its add-ons installed.

To change it back you just need to remove the file /etc/apt/apt.conf.d/00recommends and /etc/apt/apt.conf.d/99synaptic, or comment out the two configuration lines found in those files. To delete the files run this command from a terminal:

Code: Select all

sudo rm -v /etc/apt/apt.conf.d/00recommends /etc/apt/apt.conf.d/99synaptic
Or you can follow Laurent85's post http://forums.linuxmint.com/viewtopic.p ... 0#p1135161 to change the setting using Synaptic.

Alternatively, when installing a program you can instruct to install the recommended packages just for this install. To install a program that way run this command on the terminal, replacing "program" with the (lowercase) name of the program you want to install:

Code: Select all

sudo apt-get install --install-recommends program
Again, this is the default on Ubuntu and to my mind when you have a hard disk of hundreds of gigabytes and a fast Internet connection it really doesn't make sense to not install the recommended packages that give your program more functionality. One day you'll find yourself here back on the forum with a non-function just installed program, with me telling you to install the recommended packages to fix it :wink:
Last edited by xenopeek on Sat Feb 20, 2016 7:10 am, edited 2 times in total.
Reason: updated to cover synaptic
Image
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Install recommended packages to avoid problems

Post by jimallyn »

I think you can get the same functionality in Synaptic by clicking Settings, Preferences, General, and checking the box for "Consider recommended packages as dependencies."
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
ktheking

Re: Install recommended packages to avoid problems

Post by ktheking »

Just wondering , isn't that undoing the efforts that Clem put into it :lol: ?
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

I don't know the exact reason for this change, but I do see the fallout of it in problems users are having on the forums. Considering also that it by default gives you a program with less functionality, I think it's better to stick to the upstream default of always installing recommended packages.
Image
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Install recommended packages to avoid problems

Post by panorain »

I like the 'Lean N mean' approach myself. I think Clem has been doing something right.

By the way I really enjoy the 'MATE' desktop.

:D
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
Pjotr
Level 24
Level 24
Posts: 20048
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Install recommended packages to avoid problems

Post by Pjotr »

@xenopeek: I propose this improvement:

Code: Select all

sudo mv -v /etc/apt/apt.conf.d/00recommends /
... this has as main advantage, that it's easy to undo, because the settings file is not deleted but only moved to the root folder (from which it can be put back, if so desired). Plus the -v variable tells the user, what has happened.

What do you think?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

Added the -v switch (I have that as a default alias on all commands that support it, hence I never type it :wink:).

Looked into Dir::Ignore-Files-Silently setting. Default configuration ("apt-config dump" to see it; "man apt.conf" to read about the settings) ignores files with extension .disabled. So the better approach, if you want to be able to switch back, is to use:

Code: Select all

sudo mv -v /etc/apt/apt.conf.d/00recommends /etc/apt/apt.conf.d/00recommends.disabled
Image
User avatar
Pjotr
Level 24
Level 24
Posts: 20048
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Install recommended packages to avoid problems

Post by Pjotr »

That looks even better. :)

I can't imagine why Mint is deviating from the Ubuntu way, on this issue. Are there any other reasons than saving a few MB's of disk space?

Could you perhaps contact the devs about this?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
threadbane

Re: Install recommended packages to avoid problems

Post by threadbane »

xenopeek wrote:Many a user here on the forum can be found having trouble with installing programs on Linux Mint, because recommended packages are not automatically installed. Ubuntu on the other hand automatically installs recommended packages. Using a guide or tutorial for Ubuntu will thus not give you the desired outcome. Sometimes it may be just that some add-ons for the program aren't installed, limiting functionality but leaving the program otherwise working. However, I've helped quite a lot of people both here and on IRC that were left with completely non-functioning programs because recommended packages weren't installed.
...
One day you'll find yourself here back on the forum with a non-function just installed program, with me telling you to install the recommended packages to fix it :wink:
First, thanks for all the welcomes!

Second, this sounds like the answer! I'll get around to giving this a go sometime soon! Muchas gracias!! (Golf season ...)
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Install recommended packages to avoid problems

Post by jimallyn »

xenopeek, is there a way we can install the recommended packages, after the fact, for everything we have already installed?
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

I don't think that's trivial to do fully automatically. But assuming you know which packages you installed that you want to install recommended packages for, or you can fish them out of this list:

Code: Select all

grep ' install ' /var/log/dpkg.log
Then you could query with the command "apt-cache depends packagename" what their recommended packages are and install those yourself or use the command "sudo apt-get install --install-recommends packagename" to reinstall the package along with installing recommended packages.

If you're not confused by programs you installed not work, perhaps don't bother with it. Obvious ones I've seen recently have been installing VirtualBox doesn't install the recommended graphical user interface so you can only it from the terminal. Another one was if for some reason you have trouble with VLC and remove it and then reinstall it, it doesn't install plugins to use PulseAudio for output. I don't think I've managed to get through to the developers that it's a silly thing to do, not installing recommended packages,
Image
effected

Re: Install recommended packages to avoid problems

Post by effected »

Hello,
I just tried to get the recommended packages to work on my system.
Running Linux Mint 17.2 AMD 64 bit cinnamon
I used the "sudo mv -v /etc/apt/apt.conf.d/00recommends /etc/apt/apt.conf.d/00recommends.disabled" in a terminal,then rebooted,then checked the application I wanted to install with ""apt-cache depends packagename".To see what the recommended software was.

I then used the software manager to install the application,and it did not install any of the recommended software.

Specifically I am working on getting KDEnlive installed.(not that recommended packages actually made it work,but I still have other things to try)

Since that didnt work I used "sudo apt-get install --install-recommends program" and that worked.

I am just wondering why renaming the 00recommends file did not work.I have gone into the directory and the file is renamed to 00recommends.disabled
Did I do something wrong or miss a step?Is there is another way to make the software manager use recommended packages in the future?

Thanks.
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

Possibly the problem is with it being a KDE application? See near the end of the release notes the bit about issues with KDE applications: http://www.linuxmint.com/rel_rafaela_cinnamon.php
Image
altair4
Level 20
Level 20
Posts: 11444
Joined: Tue Feb 03, 2009 10:27 am

Re: Install recommended packages to avoid problems

Post by altair4 »

I have a procedural question.

So if I run the following on say Mint 17.3 Cinnamon:

Code: Select all

grep "APT::Install-Recommends" /etc/apt/apt.conf.d/*
I get the following result:
/etc/apt/apt.conf.d/00recommends:APT::Install-Recommends "false";
/etc/apt/apt.conf.d/99synaptic:APT::Install-Recommends "false";
The 99synaptic version comes from Ubuntu --- except there it's set to "true"

If by following your recommendation 00recommends is disabled or removed isn't 99synaptic still engaged?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

If it is set to true that would be fine; in your output it is set to false?

I don't have that file here:

Code: Select all

$ grep "APT::Install-Recommends" /etc/apt/apt.conf.d/*
/etc/apt/apt.conf.d/00recommends:APT::Install-Recommends "false"
$ 
Image
altair4
Level 20
Level 20
Posts: 11444
Joined: Tue Feb 03, 2009 10:27 am

Re: Install recommended packages to avoid problems

Post by altair4 »

Interesting.

I have installed every version of Mint17.3:

In Cinnamon and MATE both of these files exist by default:

00recommends
99synaptic

Both are set to have recommends as false so your original HowTo would fix one of them but not both.

Only in XFCE does there exist only the 00recommends file.

All of these were installed from the iso and not upgraded from earlier Mint versions.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Install recommended packages to avoid problems

Post by Laurent85 »

Actually if a user launch Synaptic the program will create its system wide /etc/apt/apt.conf.d/99synaptic file setting with APT::Install-Recommends set to false, overriding 00recommends setting. So whatever 00recommends setting value or file removed, 99synaptic will prevail, this might confuse a user enable to figure out why the tutorial fails to properly install recommended packages with 00recommends removed.
Image
altair4
Level 20
Level 20
Posts: 11444
Joined: Tue Feb 03, 2009 10:27 am

Re: Install recommended packages to avoid problems

Post by altair4 »

Laurent85 wrote:Actually if a user launch Synaptic the program will create its system wide /etc/apt/apt.conf.d/99synaptic file setting with APT::Install-Recommends set to false, overriding 00recommends setting. So whatever 00recommends setting value or file removed, 99synaptic will prevail, this might confuse a user enable to figure out why the tutorial fails to properly install recommended packages with 00recommends removed.
That's the key!!!

I was wondering why my Cinnamon and MATE installs had both but my XFCE did not. I never ran synaptic on the XFCE install. Now that I did you are correct. I now have both files on all versions of Mint 17.3 and agree with your conclusion that fixing one doesn't fix both.

EDIT: By the way doing something like this doesn't work:

Code: Select all

sudo mv -v /etc/apt/apt.conf.d/99synaptic /etc/apt/apt.conf.d/99synaptic.disabled
The next time synaptic in invoked it recreates it and sets it to false. What does seem to work is actually editing 99synaptic and changing "false" to "true"
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
xenopeek
Level 25
Level 25
Posts: 29586
Joined: Wed Jul 06, 2011 3:58 am

Re: Install recommended packages to avoid problems

Post by xenopeek »

I've updated the original post. Some testing shows Synaptic copies the setting from /etc/apt/apt.conf.d/00recommends to /etc/apt/apt.conf.d/99synaptic. If /etc/apt/apt.conf.d/00recommends doesn't exist it will write the default value to /etc/apt/apt.conf.d/99synaptic, which is to install recommended packages. So as long as you delete both of these files, or comment out the "APT::Install-Recommends" line in both, or edit them from value "false" to "true", you're all good and Synaptic won't mess things up.

Goes to show, I never use Synaptic on my installs.
Image
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Install recommended packages to avoid problems

Post by Laurent85 »

I would also suggest this graphical user interface tutorial:

Launch Synaptic > Settings > General tab > tick Consider recommended packages as dependencies > Apply

The Synaptic setting will prevail over Mint setting, Synaptic acting as a system wide toggle switch.
Image
Post Reply

Return to “Tutorials”