Home_greyopenFATE - openSUSE feature tracking > #300758
Dashboard | Search | Sign up | Login

Please login or register to be able to edit or vote this feature.

Show unneeded packages

Feature state

Rejected Information


The package manager should learn to show unneeded packages (packages which are not required by other packages and are not in wanted selections) and allow to deinstall them like the popular debfoster/deborphan tools.

A typical use case: user installs an application which pulls in some
dependencies to test it, uninstalls the application shortly after or way later
but the dependencies stay unused installed on the system.

Commandline UI (zypper) only.




icons/user_comment.png J. S. wrote: (11 years ago)

Schubi, is there any possibility to make solver tell which packages are orphanized? It would be interesting especially if the packages which are marked for deletion were considered as non-installed (eg. if foo-devel is installed but marked for deletion and nothing else requires foo, then foo is orphanized).

icons/user_comment.png S. S. wrote: (11 years ago)

Currently not cause the solver has no information about who (user, package,...) has triggered the installation of a package.
If we are storing this information it would be possible for solver to remove these kind of packages too. It is not simple but doable.
By the way, we will have to store this kind of information in the future. E.g. we need to save the "keep state by user" in a database in order to regard this state in future solver runs.

icons/user_comment.png J. S. wrote: (11 years ago)

Looks like a missunderstanding.

Basically every package wihch is not required/recommended/suggested or doesn't enhance anything that is installed and not marked for deletion is IMO considered to be orphanized.

If user eg. wants to remove a pattern including all its packages (which are not required by something else), solver providing this kind of information would help a lot (and I don't think that we would need any other information to be stored.

icons/user_comment.png S. S. wrote: (11 years ago)

I do not think so. What does "orphanized" mean ?

Let me take your example from comment #1.

foo should be deleted too if the user delete foo-devel and foo has been installed due the requirement of foo-devel. BUT the user will kill us if we are deleting foo although the user has installed foo explicit sometime ago in a seperate installation workflow. So this information ( The USER has installed foo) will be currently not saved and is needed here to decide if foo has to be deleted or not.

icons/user_comment.png S. S. wrote: (11 years ago)

Lets take your example concerning the erasing of patterns.

That is much more complex. I have already described the problem here:

" Proper behaviour of erasing patterns"

There are already some bugzilla entries:
Bug #274283 - Delete iFolder from YaST makes eDirectory Delete mandatory
Bug #238250 - YaST does not upgrade an Add-on Product

icons/user_comment.png J. S. wrote: (11 years ago)

See also https://bugzilla.novell.com/show_bug.cgi?id=166132

This is another use case for the same solver functionality

icons/user_comment.png F. L. wrote: (10 years ago)

this should be commandline-only, definitely an advanced-user option.

icons/user_comment.png F. L. wrote: (10 years ago)

cut from description:

See Bug #140346

icons/user_comment.png D. M. wrote: (9 years ago)

As discussed in Prague, this could be done using the package history once we have a reader.

icons/user_comment.png K. K. wrote: (9 years ago)

How about using rpmorphan, I agree with flucifredi about the command line idea...

And otherwise you could use their system to find orphanized packages and display them in yast but make clear that deleting -all orphanized packages will also delete the ones explicitly installed... (it only detects wether the package fullfiles any requirement...)

icons/user_comment.png J. K. wrote: (9 years ago)

I'm not the solver developer, but i'm pretty sure it's easy (and probably more effective) to find the 'leaf' packages (that's what rpmorphan seems to do) using existing solver (see satsolver package).

But we don't want to just highlight leaf packages, we want to remove unused packages, that is all leaves minus those explicitly installed. So we will feed the solver with this 'explicitly-installed' information. The package history will be the source of this info for now. Maybe later we find some way to store this info that could be used across tools (e.g. directly in the rpm db). So rpmorphan will be able to use this info as well.

icons/user_comment.png P. R. wrote: (9 years ago)

Yes, that's good idea. Detecting leaf packages is the first step. Detecting which ones to remove (i.e. not explicitly installed) is the second.

I think that rpmorphan shows all leaf packages, but it selects only the ones that start with "lib". If we strictly followed library packaging policy that would do the trick.

btw. rpmorphan is packaged in

icons/user_comment.png M. S. wrote: (9 years ago)

I am afraid of using rpmorphan to do this.
Cause last time, I tested it, it wants to remove libdvdnav and libdvdcss libraries.
This is very bad. It leads to many not advanced users to ask in phorums "Why OpenSUSE is not playing DVDs anymore?"

I see many problems this could make.

icons/user_comment.png C. T. wrote: (9 years ago)

We don't have the resources to implementing this. Seems to be a prefect fit for a community project.

icons/user_comment.png P. J. wrote: (9 years ago)

Maybe the idea to accomplish this would be simply by using the packages.xml file and diff it. We can already export what packages we got right? So if it would compare the packages.xml before installation and after it would then delete it. There is a problem when installing many packages, they would all have to be "grouped" which pulled which dependencies.

icons/user_comment.png V. K. wrote: (8 years ago)

This feature is a specially important, now when we have distro upgrade, which changes a lot of dependencies and a lot of obsolete packages remain installed.

Please, someone implement it!

icons/user_comment.png T. G. wrote: (8 years ago)

I've added a view for orphaned packages in yast2-qt-pkg. There is a package group "orphaned packages" similar to "suggested packages" and "recommended packages" in yast2-qt-pkg version 2.18.17.

icons/user_comment.png A. B. wrote: (8 years ago)

Thanks for implementing this much needed feature. But this feature does not work with the gtk interface in 11.2 RC2; please have this added for the final release of 11.2.

icons/user_comment.png K. J. wrote: (8 years ago)

Tried to test this but didn't seem to work on RC2: Orphaned packages view is empty. E.g. installed blender, which pulled yafray. After uninstalling blender, yafray remained installed but didn't show up as an orphaned package.

Also installing audacity or inkscape pulled a lot of dependencies which were not showed as orphaned after uninstalling them.

icons/user_comment.png K. J. wrote: (8 years ago)

Since it is marked as done, I filed a bug for it:


icons/user_comment.png J. K. wrote: (8 years ago)

There has been a misunderstanding here. What Thomas implemented is a view of packages that no longer have update candidates (those which are probably no longer maintained, thus 'orphaned').

This very fate request (IMO) incorrectly uses the word 'orphaned' for what is better described as "unused packages" or "no longer needed packages", or "unnecessary packages". Definitely not orphans (deborphan/rpmorphan is also a misfortunate name IMO).

Anyway, whether orphan or unused, this feature is not implemented yet, thus i'm reopening it for 11.3.

icons/user_comment.png J. K. wrote: (8 years ago)

reopening for 11.3 (see comment #25)

icons/user_comment.png J. K. wrote: (8 years ago)

I suggest to call these packages
unused instead of
orphaned . I don't want to decide this by myself, so please speak up. Here are my arguments:

  1. the word 'orphan' describes something that has lost its parent(s). In this case, it is actually the child that was lost - a package that depended on other package has been removed. The parent package is still installed, but there's no more use for it - it's
    unused .
  2. we (and a few other distros and communities as well) already use
    orphaned to describe packages that are no longer cared for - unmaintained packages, packages dropped from distros.
icons/user_comment.png J. K. wrote: (8 years ago)

Thomas suggests that perhaps
not needed (or
no longer needed ) would be better than
unused since 'unused' can be confused with 'not used by user' rather than 'not used by other packages'.

icons/user_comment.png R. M. wrote: (8 years ago)

Undependent packages : packages which don't have any(more) dependency.

icons/user_comment.png K. J. wrote: (8 years ago)

I also support the
not needed / no longer needed version. Orphaned is bad since it can be misunderstood, just like "undependent package", if Roberto meant to suggest it as a description for this phenomenon.

Case A: If I install manually package X, which doesn't have any dependencies nor is it referred to by any other package, it is
not a "not needed" one. 'Cause it was manually installed by the user.

Case B: Package X is installed
automatically as a dependency while installing package Y. Package Y is then removed, but X stays, with no other package referring to it as a dependency. X is then a "not needed" package.

icons/user_comment.png R. M. wrote: (8 years ago)

+1 Kornél

Regarding Case A: of course "not needed package" is a subset "undependent package" - "not needed" catches the user's point of view and it is more precise. Nevertheless, determining that "not needed" packages is a hard job, so it could be a good starting point just knowing which are the "undependent" ones (at least as a first step).

icons/user_comment.png R. M. wrote: (8 years ago)

The user could have a graphical list of "undependent packages", which then he could mark each of them as "used/not used". The GUI then could suggest the "unused packages" for removal (this being a temporary but useful use case).

icons/user_comment.png K. S. wrote: (8 years ago)

When you install a package using package management it checks to make sure all dependencies are also installed or adds them to the install list via the "Requires" feature. When de-installing the package check the list of "Requires" packages and see which ones can also be de-installed. That way there are no left over packages. If one of the "Requires" packages are also needed by other packages they are left installed. I am no where near being a programmer but that would seem to be simple to do.

icons/user_comment.png J. K. wrote: (8 years ago)

Such procedure would also wipe out packages that you still want to use. E.g. you have nagios-plugins-zypper, which requires zypper. Now, 'zypper remove nagios-plugins-zypper' would realize that after removing nagios-plugins-zypper nothing requires zypper, and would want to remove zypper as well.

So what your idea lacks is a list of packages that were installed in the past based on explicit request by user. The procedure must avoid removing these.

See also c#12

icons/user_comment.png J. K. wrote: (8 years ago)

So i'm renaming this fate request to 'Show unneeded packages' (to make it shorter) to avoid further confustion.

icons/user_comment.png D. H. wrote: (8 years ago)

I also would like to see this feature.  I currently use rpmorphan with a list of things that it will mark that I know that I need.  I also occationally go through yast2 and try to uninstall things that I do not recognize and see if they are flagged as being needed by something else.  Both time consuming and error prone.

And, a lot of packages seem to be some what careless in what the require for prereqs -  pulling in KDE,gnome, and X11 packages on text-only machines for example; which then triggers a flood of KDE, gnome, and X11 library installations which I then have to mannually uninstall and mark as taboo.

On my external facing servers I do not like to have any extra/unneeded/unwanted packages to provide possible attack vectors.

icons/user_comment.png R. B. wrote: (8 years ago)

Hello, this is one of the main causes of I use more Debian/Ubuntu than OpenSuse. Debian & Ubuntu already have this implemented.

I think this is a fundamental aspect to work in OpenSuse.

Debian & Ubuntu can distinguish packages that were manually installed and packages that were installed just to satisfy dependencies. OpenSuse needs to do this too.

icons/user_comment.png T. E. wrote: (8 years ago)

I'd also like to see this, Mandriva added it in a couple of releases ago and it's great. It's really missing in Opensuse

icons/user_comment.png E. H. wrote: (8 years ago)

Agreed. Being a long time user of both Gentoo and Ubuntu, I was really shocked to discover that zypper was lacking this feature.

Even more: when talking about Linux with friends I always make mention of this kind of "autoremove unneeded" option as one of the strong points of Linux package managing systems, as I was really taking for granted that any package manager out there had this feature included...


icons/user_comment.png R. M. wrote: (8 years ago)

Michael Andres started to implement this feature in Libzypp 7.4, see http://lists.opensuse.org/zypp-devel/2010-04/msg00033.html

icons/user_comment.png R. K. wrote: (7 years ago)

--clean-deps works indeed, but what about just showing unneeded packages?

It's mentioned in http://en.opensuse.org/Product_highlights#Package_management_with_zypper but I haven't found any information about this feature.

icons/user_comment.png M. B. wrote: (6 years ago)

This FATE is marked as done but as of 11.4 "zypper rm -u" doesn't work without a package name. It cannot actively find and remove orphaned package which are auto-installed, like "apt-get autoremove" does.

icons/user_comment.png M. S. wrote: (6 years ago)

True. We can add that for 12.2, but the quality of the result really depends on knowing which packages were selected by the user and which packages were dragged in via dependencies.

icons/user_comment.png C. M. wrote: (5 years ago)

That info is available already through the history, isn't? The only problem I know of is Bug #679213... that I have no idea if was fixed since the info is not public :-(

icons/user_comment.png J. S. wrote: (5 years ago)

I have this information in the log of my 12.1.

icons/user_comment.png M. S. wrote: (5 years ago)

Just for completeness: 12.2 has an "unneded packages" package group.

icons/user_comment.png J. P. wrote: (6 years ago)

For images generated in a SLEPOS environment, we would like the to reduce the footprint.
So we'd like to find out all packages where last use (per read access time stamp) <= install time.
This list we would the transfer back to the image creation server so that the next image gets reduce to what we really need.

Btw. removedthe big list of rejected openSUSEs besides the first and last to get a better overview again while keeping the history

icons/user_comment.png J. S. wrote: (5 years ago)

Jack, does this necessarily involve libzypp/zypper? I think that this is a rather specific use-case, which can be scripted easily.

Besides, I suggest to handle this as a separate request - this one is about unneeded, not about unused.

icons/user_comment.png C. K. wrote: (4 years ago)

Why is this ticket set to "Done" (for openSUSE-11.3) - has this feature been implemented. I could not find anything related in zypper(8) in 12.3 - is a new ticket required to have this resolved?

A possible (but possibly dangerous) workaround would be to use YUM:

$ zypper install yum-utils 
$ zypper remove --dry-run `package-cleanup --quiet --leaves`
The "--oldkernels" isn't working here though:

package-cleanup --oldkernels 
Setting up yum
Traceback (most recent call last):
File "/usr/bin/package-cleanup", line 419, in <module>
File "/usr/bin/package-cleanup", line 388, in main
removeKernels(my, opts.kernelcount, opts.confirmed, opts.keepdevel)
File "/usr/bin/package-cleanup", line 293, in removeKernels
(kver,krel) = runningkernel.split('-')
ValueError: too many values to unpack
icons/user_comment.png M. S. wrote: (4 years ago)

There's both "zypper remove --clean deps" and a "unneeded packages" group in YaST.

icons/user_comment.png C. K. wrote: (3 years ago)

Sorry for the late reply, I haven't used openSUSE in a long time. "zypper remove --clean deps" is not working in 13.1, as "deps' is not a package. But "unneeded packages" in YaST works - thanks!

# zypper remove --clean deps 
Loading repository data...
Reading installed packages...
'deps' not found in package names. Trying capabilities.
No provider of 'deps' found.
Resolving package dependencies...
Nothing to do.

icons/user_comment.png M. E. wrote: (3 years ago)

The syntax is

zypper remove --clean-deps [packagename]

Last change: 3 years ago
Score: 266
  • Negative: 2
  • Neutral: 0
  • Positive: 268
Feature Export
Application-xmlXML   Text-x-logPlaintext   PrinterPrint