Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

While installing package I get some additional packages on dependency. But when I remove installed package with yum, the dependency packages are not removed, though I don't need them anymore.

How can I remove them automatically?

share|improve this question

2 Answers 2

package-cleanup in yum-utils will give you a list of packages that are not longer used. It cannot automatically remove them though it would be simple to use the output in a script that did this.

You could also look into a yum plugin called remove-with-leaves. I have never used it so I'm not sure of its compatibility with the version of yum in CentOS 5. Also, people seem to have a lot of problems given the results of a quick google search.

share|improve this answer

Check out "package-cleanup" in yum-utils (yum install yum-utils).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.