Thanks for the info! I’m definitely getting closer!!
One tweak I made to the script was to add
--unique to the sort command. I only need to see the package name once.
The mention of the bugzilla item lead me to find the ‘leaves’ plug-in for dnf. Basically, all you have to do is
dnf install 'dnf-command(leaves)'
However that gives different results from the script provided. As an example from my system, comparing the script (left) to leaves (right) using diff shows
So it’s not that only one is including packages that the other does not; each has their own idea of what “is not a dependent” means. It may have to do with leaves’ reciprocal logic (if A depends on B and B depends on A, both A and B will be listed by leaves if no other package is dependent on either), but that doesn’t account for the script’s listing of a package not listed by leaves…
I haven’t yet determined which I consider “better” for my purposes, but will post back once I do, and if there seems to be any logic as to why there are differences.
As an aside, I really don’t like the term “unused” in this context, and “leaf” is just as bad for different reasons. Is there any real reason to not use “no dependents” or “not a provider”?
And aside #2, I was pretty disappointed with the bugzilla comments. I really, really wish people would stop trying to protect me from myself! (Not just bugzilla posts or software, but with laws, too!) I’ll step off my soapbox now…
Thanks to all for the help so far!