Bug#627996: Tool to automatically mark packages as auto-installed

2013-04-15 Thread Mente Binária | Sérgio Santos
Thanks a lot for that /etc/apt/apt.conf.d/01autoremove tip! I only ever 
go to /etc/apt to mess with the sources, i had never heard about that 
set of rules. More power for me! :)


Also, before permanently closing this "bug", i'd like to thank you (and 
the rest of the team, of course) again for Synaptic - no "software 
centre" can replace it.


Best regards,
Sergio


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#627996: Tool to automatically mark packages as auto-installed

2013-04-15 Thread Daniel Hartwig
On 15 April 2013 22:04, Mente Binária | Sérgio Santos
 wrote:
> But i guess you're right, i am proposing a half-baked solution to
> a problem that shouldn't exist in the first place.
>
> Still, the problem does exist: often, after installing a package (if i
> don't perform that procedure of mine) i notice that many of the
> automatically installed packages are marked as manually installed.
>
> For example (and i have just checked this on purpose), if i mark
> the package "ubuntu-desktop" for installation, the packages
> "at-spi2-core", "baobab" and some other dependencies (and
> i do mean dependencies, not recommendations) are not marked
> as auto-installed. Maybe i'm asking the wrong person, but
> why is that? Are there different types/levels of dependency flags?

ubuntu-desktop is in section metapackages, which is configured as one
of Never-MarkAuto-Sections (see /etc/apt/apt.conf.d/01autoremove).
The effect of this is that its dependencies are not marked
auto-installed.  At some point this was deemed preferable for
metapackages, as otherwise users were complaining that removing such
desktop package removed their whole desktop (imagine that? :-).

If you dislike that you can modify the configuration on your own
system to exclude metapackages from that config.  If you see the
problem with packages in other sections, please report to launchpad.

>
> By the way, i use Synaptic 0.75.9ubuntu1 on Xubuntu 12.04.
>

I believe that on such a system there still exist some problems with
e.g. update-manager (via aptdaemon) that were only fixed quite
recently.

Otherwise, you should report any new issues to launchpad.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#627996: Tool to automatically mark packages as auto-installed

2013-04-15 Thread Mente Binária | Sérgio Santos

  
  
"So, the list of unmarked packages now potentially includes all
dependencies of xfce4:

 xfwm4, xfconf, xfce4-settings, xfce4-panel, xfdesktop4, thunar,
xfce4-utils,
 gtk2-engines-xfce, xfce4-session, xfce4-appfinder, xfce4-mixer,
orage,
 xorg, desktop-base, thunar-volman, tango-icon-theme, xfce4-notifyd

but I only ever wanted two packages, and I dont care about these
others.  The system has mixed the packages I dont want with those I
do, and I must manually intervene to restore order!"
Yes, but i see this as less of a problem than having to go through a
huge list of improperly marked packages.

But i guess you're right, i am proposing a half-baked solution to a
problem that shouldn't exist in the first place.
Still, the problem does exist: often, after installing a package (if
i don't perform that procedure of mine) i notice that many of the
automatically installed packages are marked as manually installed.
For example (and i have just checked this on purpose), if i mark the
package "ubuntu-desktop" for installation, the packages
"at-spi2-core", "baobab" and some other dependencies (and i do mean
dependencies, not recommendations) are not marked as auto-installed.
Maybe i'm asking the wrong person, but why is that? Are there
different types/levels of dependency flags?

By the way, i use Synaptic 0.75.9ubuntu1 on Xubuntu 12.04.


On 15/04/13 14:31, Daniel Hartwig
  wrote:


  On 15 April 2013 16:46, Mente Binária | Sérgio Santos
 wrote:

  
Wow, i had already forgotten about this request.

"It is not appropriate to implement features like this within any particular
apt front-end.  A separate utility program is acceptable (...)"
I agree, though this utility might later be integrated in Synaptic.

"and that program is deborphan"
I disagree. deborphan's purpose is to find unnecessary libraries. What i
propose is something different.


  
  
It is for any programs and works just like you describe, but without
munging the apt auto-installed information.


  
Right now, when you install a package with
recommendations or dependencies, if you later uninstall that package some of
the dependencies/recommendations (i haven't quite figured this out yet) are
left behind - and deborphan won't spot them.

  
  

  
after
marking a package for install i visit Custom Filters > Marked Changes and
mark all other packages as "automatically installed". If i ever remove that
first package, Synaptic will show me the others under Status > Installed
(auto removable).

  
  
This is supposed to happen automatically.  If you find specific cases
where it does not report a bug.

There have been many issues getting this to work over the years, most
are resolved now.  It is likely that over time these issues have
spoiled the auto-installed information on your system leading to these
work-arounds you propose.  With the issues resolved, things will work
much better (once you restore the auto-installed information).


Entertaining your example:


  

Now, let's look at this from a common user's point of view: you ran that
utility at one point;

  
  
So I really like these packages and intentially ask for them to be installed:

 thunar, xfce4-mixer

under normal operation, apt will remember these as manually installed.
 This is great, as I don't want them removed unless I specifically ask
for that.

I also have xfce4 installed, which depends on these two.  When I run
your program it will mark both thunar and xfce4-mixer as
auto-installed.


  
now, after uninstalling an important meta-package
(something like "xfce4"), a whole bunch of them shows up as "auto
removable". No problem. Run the "auto-mark" feature again (just a suggestion
for a name) and it will unmark only the most relevant packages (the ones
without dependants).

  
  
So, the list of unmarked packages now potentially includes all
dependencies of xfce4:

 xfwm4, xfconf, xfce4-settings, xfce4-panel, xfdesktop4, thunar, xfce4-utils,
 gtk2-engines-xfce, xfce4-session, xfce4-appfinder, xfce4-mixer, orage,
 xorg, desktop-base, thunar-volman, tango-icon-theme, xfce4-notifyd

but I only ever wanted two packages, and I dont care about these
others.  The system has mixed the packages I dont want with those I
do, and I must manually intervene to restore order. #!


With the intended auto-installed semantics, this happens:

# apt-get install thunar xfce4-mixer
# apt-get install xfce4
# apt-get remove xfce4
# apt-get autoremove

I am left with exactly thunar and xfce4-mixer installed, and I never
had to look at the list of other dependencies to do this.  The system
remembers that I asked for these two packages and keeps them around.
This is the whole point of having some packages marked auto-installed
and others manual, a point defeated by your 

Bug#627996: Tool to automatically mark packages as auto-installed

2013-04-15 Thread Daniel Hartwig
On 15 April 2013 16:46, Mente Binária | Sérgio Santos
 wrote:
> Wow, i had already forgotten about this request.
>
> "It is not appropriate to implement features like this within any particular
> apt front-end.  A separate utility program is acceptable (...)"
> I agree, though this utility might later be integrated in Synaptic.
>
> "and that program is deborphan"
> I disagree. deborphan's purpose is to find unnecessary libraries. What i
> propose is something different.
>

It is for any programs and works just like you describe, but without
munging the apt auto-installed information.

> Right now, when you install a package with
> recommendations or dependencies, if you later uninstall that package some of
> the dependencies/recommendations (i haven't quite figured this out yet) are
> left behind - and deborphan won't spot them.

> after
> marking a package for install i visit Custom Filters > Marked Changes and
> mark all other packages as "automatically installed". If i ever remove that
> first package, Synaptic will show me the others under Status > Installed
> (auto removable).

This is supposed to happen automatically.  If you find specific cases
where it does not report a bug.

There have been many issues getting this to work over the years, most
are resolved now.  It is likely that over time these issues have
spoiled the auto-installed information on your system leading to these
work-arounds you propose.  With the issues resolved, things will work
much better (once you restore the auto-installed information).


Entertaining your example:

>
> Now, let's look at this from a common user's point of view: you ran that
> utility at one point;

So I really like these packages and intentially ask for them to be installed:

 thunar, xfce4-mixer

under normal operation, apt will remember these as manually installed.
 This is great, as I don't want them removed unless I specifically ask
for that.

I also have xfce4 installed, which depends on these two.  When I run
your program it will mark both thunar and xfce4-mixer as
auto-installed.

> now, after uninstalling an important meta-package
> (something like "xfce4"), a whole bunch of them shows up as "auto
> removable". No problem. Run the "auto-mark" feature again (just a suggestion
> for a name) and it will unmark only the most relevant packages (the ones
> without dependants).

So, the list of unmarked packages now potentially includes all
dependencies of xfce4:

 xfwm4, xfconf, xfce4-settings, xfce4-panel, xfdesktop4, thunar, xfce4-utils,
 gtk2-engines-xfce, xfce4-session, xfce4-appfinder, xfce4-mixer, orage,
 xorg, desktop-base, thunar-volman, tango-icon-theme, xfce4-notifyd

but I only ever wanted two packages, and I dont care about these
others.  The system has mixed the packages I dont want with those I
do, and I must manually intervene to restore order. #!


With the intended auto-installed semantics, this happens:

# apt-get install thunar xfce4-mixer
# apt-get install xfce4
# apt-get remove xfce4
# apt-get autoremove

I am left with exactly thunar and xfce4-mixer installed, and I never
had to look at the list of other dependencies to do this.  The system
remembers that I asked for these two packages and keeps them around.
This is the whole point of having some packages marked auto-installed
and others manual, a point defeated by your proposal which loses the
information about manually installed packages.


So, why do I want to run your program everytime I remove
something/something big?  It will cause a lot of work for me later to
keep inspecting the non-marked-manual packages for those I dont want.

Seems like a one-shot deal to not-quite restore lost auto-installed information.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#627996: Tool to automatically mark packages as auto-installed

2013-04-15 Thread Mente Binária | Sérgio Santos

Wow, i had already forgotten about this request.

"It is not appropriate to implement features like this within any 
particular apt front-end.  A separate utility program is acceptable (...)"

I agree, though this utility might later be integrated in Synaptic.

"and that program is deborphan"
I disagree. deborphan's purpose is to find unnecessary libraries. What i 
propose is something different.


"As you propose it, most packages requested by the user would be marked 
auto-installed and subsequently prone to autoremoval, which is certainly 
not desired."
Exactly, that's the whole idea! Right now, when you install a package 
with recommendations or dependencies, if you later uninstall that 
package some of the dependencies/recommendations (i haven't quite 
figured this out yet) are left behind - and deborphan won't spot them. I 
am sure of this, and i would like to provide examples, but i can't 
remember any right now. In order to remove them, i have to open Synaptic 
> Status > Installed (manual) and go through the entire list, marking 
packages as "automatically installed". I like to keep a clean system, 
and this is annoying. Actually, i have recently come up with a different 
strategy: whenever i install something, after marking a package for 
install i visit Custom Filters > Marked Changes and mark all other 
packages as "automatically installed". If i ever remove that first 
package, Synaptic will show me the others under Status > Installed (auto 
removable).


Now, let's look at this from a common user's point of view: you ran that 
utility at one point; now, after uninstalling an important meta-package 
(something like "xfce4"), a whole bunch of them shows up as "auto 
removable". No problem. Run the "auto-mark" feature again (just a 
suggestion for a name) and it will unmark only the most relevant 
packages (the ones without dependants). I can see where this might go 
wrong, so we should add the following two conditions to the utility:

- Always consider libraries as auto removable.
- Accept a parameter with a list of exceptions to the above condition, 
to help prevent libraries like "libdvdcss2" from being uninstalled.
- A simulation mode, where instead of marking packages, it would only 
print/return the packages it would have marked as "manually installed.


I wish i could create this utility myself, but it's been ages since the 
last time i programmed in any language other that those for the web, and 
i know very little about apt and dpkg.


Regards.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#627996: Tool to automatically mark packages as auto-installed

2011-05-26 Thread Mente Binária | Sérgio Santos
Package: synaptic
Version: 0.75.1ubuntu2
Severity: wishlist

Thank you for Synaptic. I've tried all the other popular package managers and 
this is definitely the best (although it could borrow some ideas from YaST).

I like to keep my system free from unnecessary packages, and a feature that 
would greatly help me do this would be a tool that would go through each 
package not marked as auto-installed and check if any dependant package is 
installed. If any dependant package is installed, mark the current package as 
auto-installed. This seems like a simple algorithm to implement.

One other similar feature would also help: a tool that would first mark all 
installed packages as auto-installed and then go through each package marked as 
auto-installed, checking if any dependant package is installed. The tool would 
go through the "tree" of packages and only unmark the main package(s) as 
auto-installed.
This algorithm comes to mind:
- a pointer to an array of installed packages (the packages in this array could 
be sorted by decreasing number of dependencies, to increase the efficiency of 
the tool) would be supplied to a recurring function, which would also accept a 
single package as a second parameter;
- this function would pick the first package still in the array (if that second 
parameter isn't given) and remove that package from the array;
- then, if the function finds that none of the dependant packages is installed, 
it unmarks the current package as auto-installed and exits;
- otherwise, the function calls itself for each dependant packages still in the 
array;

I don't even know if the programming language of Synaptic supports what i 
describe here, but any of these features would make it easier for a user to 
remove unnecessary packages, and the second function could be reused by an 
automated package removal tool. I am indeed a programmer, but i think such 
features would be easier to implement for someone who is already in the project.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org