Why Doesn't Yum Clean Up Orphaned Packages?

3

2

I recently used Yum (on Fedora 13) to install xmms2. It found some dependencies and installed those as well. Immediately after I installed xmms2, I performed yum erase xmms2, but it uninstalled only the xmms2 package, and not the packages that were installed along with it to resolve dependencies. I also tried performing package-cleanup --orphans, but it doesn't list those packages. What is happening here? Shouldn't the other packages be uninstalled as well?

TripShock

Posted 2010-08-22T05:29:59.357

Reputation: 190

2Though this is an old question, it's also worth pointing out that part of the issue here is that yum terminology is a bit different. That's why 'package-cleanup --orphans' didn't work as expected — because an "orphan" isn't what you think.

Packages that don't exist as dependencies (aren't required by any other installed package) are called leaves in yum. An "orphaned" package is one that's installed on the system, but not available in any configured repository. So, any rpm installed by hand, from a disabled repo, or that's been removed from its source repo since it was installed. – FeRD – 2011-07-06T12:23:12.967

Answers

4

It's a design decision that was made long, long ago. install yum-plugin-remove-with-leaves if they irk you so.

Ignacio Vazquez-Abrams

Posted 2010-08-22T05:29:59.357

Reputation: 100 516

3

In yum-3.2.28-13 it does remove orphaned packages with clean_requirements_on_remove=1 under [main] in /etc/yum.conf. According to this link: Testing yum’s autoremove orphaned deps feature.

minghua

Posted 2010-08-22T05:29:59.357

Reputation: 398

Works like a charm. Why isn't this behaviour default? – Bengt – 2012-08-15T11:17:30.453

3

If someone ends up here in this old question....

just use

yum autoremove

It will work like running clean_requirements_on_remove turned on. It will remove your stubborn packages. ;-)

(I use CentOS 7)

mayor

Posted 2010-08-22T05:29:59.357

Reputation: 31