I have made a patch to fix this bug. Please leave a comment if the
solution is good enough to merge. To test you need to unpack synaptic
0.62.x or later and then do:
$ patch synaptic-0.62.x/common/rconfiguration.cc <attached>.patch
The problem I found: synaptic once changed its config location
to /root/.synaptic/synaptic.conf. And because no other tool would ever
read this file, synaptic filters out all config tags that do not start
with "Synaptic::". That's why "APT::Install-Recommends" does not get
stored anymore.
In distros like Ubuntu it was decided in 2008 that the built-in default
"false" is not optimal. Therefore a file /etc/apt/apt.conf.d/01ubuntu
was created, containing one line:
APT::Install-Recommends "true";
With that in mind I tried to make my patch as minimal-invasive and
robust as possible: whenever synaptic stores its config, a
file /etc/apt/apt.conf.d/99synaptic is also written, containing the
above line ending with "true" if the corresponding checkbox is checked
or "false" otherwise. This file overrides preceding files
like /01ubuntu. And if writing fails for some reason then the only
consequence is a message sent to stderr.
I tested this patch against synaptic-0.62.7 and it works for me.
+++ Oliver
--- synaptic-0.62.7ubuntu6/common/rconfiguration.cc.orig 2009-10-15 18:58:25.000000000 +0200
+++ synaptic-0.62.7ubuntu6/common/rconfiguration.cc 2010-02-22 02:44:25.000000000 +0100
@@ -98,6 +98,22 @@
cfile.close();
+ // quick fix to store the option 'consider recommended packages as dependencies'
+ string aptConfPath = _config->Find("Dir", "/")
+ + _config->Find("Dir::Etc", "etc/apt/")
+ + _config->Find("Dir::Etc:parts", "apt.conf.d")
+ + "/99synaptic";
+ ofstream aptfile(aptConfPath.c_str(), ios::out);
+ if (!aptfile != 0) {
+ cerr << "couldn't open " << aptConfPath.c_str() << " for writing APT::Install-Recommends" << endl;
+ } else {
+ if (_config->FindB("APT::Install-Recommends", false))
+ aptfile << "APT::Install-Recommends \"true\";" << endl;
+ else
+ aptfile << "APT::Install-Recommends \"false\";" << endl;
+ aptfile.close();
+ }
+
return true;
}