Re: zypper-1.14.70 will support a new option: 'dup --remove-orphaned' to remove all unneeded orphans.
On Tuesday 26 March 2024 09:09:31 Michal Hrusecky wrote:
Michael Andres via openSUSE Factory - 8:54 26.03.24 wrote:
On Monday 25 March 2024 22:30:26 -pj via openSUSE Factory wrote:
On 03-25-2024 08:31AM, Michael Andres via openSUSE Factory wrote:
...and not just the ones otherwise blocking the dup.
Would passing the command then wipe out needed existing orphaned files? e.g. On the machine here there are important and needed printer and scanner packages.
'Needed' is 'required by other packages', not 'important for user or functionality'.
How does zypper tracks what is Needed? Dependency-wise, there has to be something requiring leaf packages in dependency tree. When I install `mc`, there is no other package requiring it, so it is Unneeded orphan? 🤔 This sounds like something I was missing for quite some time, would be nice to see a list of leaf packages that I have installed and decide that I no longer need this branch... Or did I misunderstood what it does?
An orphan (AKA dropped, unwanted) (zypper packages --orphaned) is a package which is not part of any enabled repository nor does it have update candidates within those repos. So orphans contain discontinued packages as well as 3rd party packages IF they are not provided by a repository. Unneeded (zypper packages --unneeded) are autoinstalled packages which are not required by other packages. When removing packages you can use `zypper remove --clean-deps` to remove the package along with it's unneeded dependecies (or set solver.cleandepsOnRemove in /etc/zypp/zypp.conf and use --no-clean-deps to disable it for one command). -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres (he/him/his), Engineering & Innovation, ma@suse.com +------------------------------------------------------------------+ SUSE Software Solutions Germany GmbH www.suse.com Frankenstr. 146, 90461 Nuernberg, Germany Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg) +------------------------------------------------------------------+
On Tuesday 26 March 2024 09:25:33 Michael Andres wrote:
How does zypper tracks what is Needed? Dependency-wise, there has to be something requiring leaf packages in dependency tree. When I install `mc`, there is no other package requiring it, so it is Unneeded orphan?
It's perhaps no orphan (because present in your repos) but also not auto-installed if you manually installed it. [man zypper] Automatically installed packages Packages added by the dependency solver in order to resolve a user’s request are remembered as having been automatically installed. They may later be removed, if no more user installed packages depend on them (e.g. by zypper remove --clean-deps). In the Status column the search command distinguishes between user installed packages (i+) and automatically installed packages (i). A user-installed package (i+) can never be unneeded. (And yes, a convenient command to manip the user/auto installed state of a package is still missing. By now package names can be added/removed to /var/lib/zypp/AutoInstalled. What's not mentioned in there is treated as user-installed) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres (he/him/his), Engineering & Innovation, ma@suse.com +------------------------------------------------------------------+ SUSE Software Solutions Germany GmbH www.suse.com Frankenstr. 146, 90461 Nuernberg, Germany Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg) +------------------------------------------------------------------+
On Tue, Mar 26, 2024 at 11:42 AM Michael Andres via openSUSE Factory <factory@lists.opensuse.org> wrote:
(And yes, a convenient command to manip the user/auto installed state of a package is still missing. By now package names can be added/removed to /var/lib/zypp/AutoInstalled. What's not mentioned in there is treated as user-installed)
What is rather confusing to users^Wadmins is the fact that packages automatically selected during installation/administration are considered "user installed" although users most definitely never consciously installed them. This may happen as an example due to some YaST module adding packages needed by this module, there could be other cases (I have feeling that everything added during initial installation is considered "user installed", but I may be wrong here). "User installed" implies that it is human action, maybe some other word could be used here ("explicitly installed" or similar).
Am 26.03.24 um 9:54 AM schrieb Andrei Borzenkov:
What is rather confusing to users^Wadmins is the fact that packages automatically selected during installation/administration are considered "user installed" although users most definitely never consciously installed them. This may happen as an example due to some YaST module adding packages needed by this module, there could be other cases (I have feeling that everything added during initial installation is considered "user installed", but I may be wrong here).
I've also wondered how certain packages ended up being user installed, so at some point I wrote a wrapper around zypper that diff'ed /var/lib/zypp/AutoInstalled before and after the command. If I remember correctly, packages installed as a result of conflict resolution count also as user installed, even though for the most part they're just there to fulfill some requirement. Unfortunately my "tracing" didn't cover YaST, which might also have resulted in some packages being marked as user-installed. It probably did for operations like "switch packages to other repository" that I might have done at some point.
Am Dienstag, 26. März 2024, 09:41:29 CET schrieb Michael Andres via openSUSE Factory:
On Tuesday 26 March 2024 09:25:33 Michael Andres wrote:
How does zypper tracks what is Needed? Dependency-wise, there has to be something requiring leaf packages in dependency tree. When I install `mc`, there is no other package requiring it, so it is Unneeded orphan?
It's perhaps no orphan (because present in your repos) but also not auto-installed if you manually installed it.
[man zypper] Automatically installed packages Packages added by the dependency solver in order to resolve a user’s request are remembered as having been automatically installed. They may later be removed, if no more user installed packages depend on them (e.g. by zypper remove --clean-deps).
In the Status column the search command distinguishes between user installed packages (i+) and automatically installed packages (i).
A user-installed package (i+) can never be unneeded.
Not sure how this will work...as 1.14.70 arrived I did a test run on my machine and got some manually installed packages that would be removed with --remove-orphaned: master-pdf-editor MediathekView mfc9340cdwcupswrapper mfc9340cdwlpr zoom So, this option would remove some needed packages. How can I work round this? Cheers Axel
On Wed, Mar 27, 2024 at 11:56 AM Axel Braun via openSUSE Factory <factory@lists.opensuse.org> wrote:
So, this option would remove some needed packages. How can I work round this?
It was already answered in this thread.
On Tue, Mar 26, 2024 at 11:26 AM Michael Andres via openSUSE Factory <factory@lists.opensuse.org> wrote:
Unneeded (zypper packages --unneeded) are autoinstalled packages which are not required by other packages. When removing packages you can use `zypper remove --clean-deps` to remove the package along with it's unneeded dependecies (or set solver.cleandepsOnRemove in /etc/zypp/zypp.conf and use --no-clean-deps to disable it for one command).
Any plans to also provide "zypper --remove-unneeded"? It is quite often asked for, especially by those, coming from deb (apt autoremove).
On Tuesday 26 March 2024 09:42:53 Andrei Borzenkov wrote:
On Tue, Mar 26, 2024 at 11:26 AM Michael Andres via openSUSE Factory
<factory@lists.opensuse.org> wrote:
Unneeded (zypper packages --unneeded) are autoinstalled packages which are not required by other packages. When removing packages you can use `zypper remove --clean-deps` to remove the package along with it's unneeded dependecies (or set solver.cleandepsOnRemove in /etc/zypp/zypp.conf and use --no-clean-deps to disable it for one command).
Any plans to also provide "zypper --remove-unneeded"? It is quite often asked for, especially by those, coming from deb (apt autoremove).
Yes, `zypper remove --remove-[unneeded|orphaned]` is desired. `remove-unneeded` will also need a command to control the byUser/auto installed status of a package to be able to tailor the result. `remove-orphaned` will need a change in libsolv or a way to mimic it outside `dup`. The resolver ATM provides no orphan cleanup outside dup. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres (he/him/his), Engineering & Innovation, ma@suse.com +------------------------------------------------------------------+ SUSE Software Solutions Germany GmbH www.suse.com Frankenstr. 146, 90461 Nuernberg, Germany Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg) +------------------------------------------------------------------+
participants (4)
-
Aaron Puchert
-
Andrei Borzenkov
-
Axel Braun
-
Michael Andres