openSUSE / libsolv

Library for solving packages and reading repositories
http://en.opensuse.org/openSUSE:Libzypp_satsolver
Other
509 stars 151 forks source link

Remove orphaned without distupgrade #522

Open baszalmstra opened 1 year ago

baszalmstra commented 1 year ago

Im using libsolv in a capacity where I provide everything I want to install upfront. When I do not specify a certain package and it is provided in the list of installed package I want it to be removed. It was my understanding that SOLVER_DROP_ORPHANED would yield that behavior but it appears it only makes sense to use this with the SOLVER_DISTUPGRADE flag.

What I want to achieve is the following:

1) "install" A B -> install package A and B in the environment
2) "install" A -> B is no longer specified so it should be removed

I also want A to remain the same version if it doesn't need to be upgraded. Ideally, I want to derive this information purely from the currently installed packages.

What would be the best way to achieve this?