[zypp-devel] Fwd: automatic removal of unused packages when removing a package
(initial message, several replies will be forwarded shortly) Hi, We've received several requests to provide a feature to automatically remove unused packages resulting from removing a package (or more packages). For example: i want to install 'glest': glest needs glest-data so both get installed. Then i get bored with glest and want to remove it, but currently using 'zypper remove glest' will remove only 'glest', glest-data stays needlessly installed. What i want to achieve is something like: $ zypper remove --auto-remove-whathever glest .... The following packages are going to be REMOVED: glest-data glest (maybe with an additional section in the summary like this: The following package is unused and will be removed: glest-data ) It is perfectly reasonable to be able to do this, i just wanted to ask if there already is support for this in the current solver, or it needs to be implemented. BTW: if this is not in current solver yet, i don't known whether this should be implemented in the SAT solver or still in the current solver. Cheers, Jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan Kupec schrieb:
For example: i want to install 'glest': glest needs glest-data so both get installed. Then i get bored with glest and want to remove it, but currently using 'zypper remove glest' will remove only 'glest', glest-data stays needlessly installed.
What i want to achieve is something like: $ zypper remove --auto-remove-whathever glest .... The following packages are going to be REMOVED: glest-data glest
(maybe with an additional section in the summary like this: The following package is unused and will be removed: glest-data )
Hi Jano, now it is clear, but I must disappoint you. As I have already written in fate:
"The solver needs the additional information WHY a package has been installed. (User decision, Requirement of other packages, Recommends,....). This information is not available at the moment. With this information it would be possible." There is no change to solve it, cause the solver does not have this information.
It is perfectly reasonable to be able to do this, i just wanted to ask if there already is support for this in the current solver, or it needs to be implemented.
It is mainly not a solver problem but an information problem concerning who, when and why a package has been selected for installation. This information will not be stored at the moment. Greetings Stefan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Klaus Kaempf wrote:
* Stefan Schubert
[Nov 07. 2007 11:26]: "The solver needs the additional information WHY a package has been installed. (User decision, Requirement of other packages, Recommends,....). This information is not available at the moment. With this information it would be possible."
Agreed.
This needs a 'history log', preferably grouped by transactions.
I really fail to see the reason. i'm removing a package foo $set = all of the packages on which foo depends for each $item of $set { if there is no package (other than foo) _installed_ which depends on $item { remove $item } } Why do we need more information than the info we currently have to do this? Why do we need package history? I can't think of any problem or case. Maybe you missed the *when removing a package* in the mail subject. Or it's just me missing something :O) Please explain. J. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Friday 09 November 2007 09:35:33 Jan Kupec wrote:
Why do we need more information than the info we currently have to do this? Why do we need package history? I can't think of any problem or case.
Maybe you missed the *when removing a package* in the mail subject. Or it's just me missing something :O) Please explain.
J.
Does your algorithm work for leaf packages that I install and that are not required by another packages? lets say libwt, which I use for development. As nobody depends on it, it will be removed, but it should only be removed if it was dragged by the solver , not if it was a explicit user transaction. Anyway, it sucks that rpm can save this metadata by itself. -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg Tel: +49-911-74053-437 - duncan.mac-vicar@suse.de GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar Prett wrote:
On Friday 09 November 2007 09:35:33 Jan Kupec wrote:
Why do we need more information than the info we currently have to do this? Why do we need package history? I can't think of any problem or case. Maybe you missed the *when removing a package* in the mail subject. Or it's just me missing something :O) Please explain.
J.
Does your algorithm work for leaf packages that I install and that are not required by another packages? lets say libwt, which I use for development. As nobody depends on it, it will be removed,
Yes, it could be removed by the algorithm, but that is exactly what i want from it. Nota bene, the 'zypper remove foo' would work as before! Would would have e.g. 'zypper remove --remove-unused foo' or something like that to trigger the algorithm. And yes, that _could_ result in removing libwt in the end, if no installed package uses it. But you see my point. Upon removing foo (called with this special option), i want zypper to check for those unused packages resulting from removing foo. It will display the install/remove summary and if i don't like it (wants to remove libwt, which i want to keep), i choose not to continue and reach my goal by other means. At leasts it will give me a list of such packages, that's great too.
but it should only be removed if it was dragged by the solver , not if it was a explicit user transaction.
I see! Yes, that would be a 'zypper remove --remove-unused foo' and what i am basically proposing is 'zypper remove --remove-unused --ignore-package-history foo'. *Both have sense* IMO! So it seems we should understand each other right now, so what do you think?
Anyway, it sucks that rpm can save this metadata by itself.
Can you explain? Jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Am Freitag 09 November 2007 schrieb Jan Kupec:
On Friday 09 November 2007 09:35:33 Jan Kupec wrote:
Why do we need more information than the info we currently have to do this? Why do we need package history? I can't think of any problem or case.
Maybe you missed the *when removing a package* in the mail subject. Or it's just me missing something :O) Please explain.
J.
Does your algorithm work for leaf packages that I install and that are not required by another packages? lets say libwt, which I use for development. As nobody depends on it, it will be removed, but it should only be removed if it was dragged by the solver , not if it was a explicit user transaction.
I think you need to limit your "set of packages" to the requires of glest. And then it could work. If this can't work, then I'd suggest to make "list-unused" or "remove-unused" an action separate from remove. Greetings, Stephan -- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Jan Kupec
-
Stephan Kulow