Ask Your Question

How to remove unneeded dependencies of a package?

asked 2014-01-02 09:49:34 -0500

Black_Bucket gravatar image

Hello. I want to know how to remove dependencies of a given packages that are not used anymore by the system. Usually what I do is sudo yum remove package_name, but this only removes package_name and not all the stuff it installed with it. For example, yesterday I installed exaile and yum installed three additional packages that were needed for exaile to run. But when I removed it, yum just removed the package exaile and not its dependencies.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-01-02 11:05:28 -0500

Period 22 gravatar image

updated 2014-01-02 12:05:59 -0500

Use sudo yum autoremove. That does the job nicely.

edit flag offensive delete link more


@Period It worked perfectly. I did a little research and found that package-cleanup is a bit unreliable. On the other hand yum autoremove works as if you had enabled clean_requirements_on_remove, which is a feature added by Seth Vidal to yum for taking care of 'leaf packages'. Thanks.

Black_Bucket gravatar imageBlack_Bucket ( 2014-01-02 14:55:39 -0500 )edit

This worked for me, thank you very much, +1

490182 gravatar image490182 ( 2014-11-26 23:41:51 -0500 )edit

answered 2014-01-02 10:00:56 -0500

Use package-cleanup. For example,

package-cleanup --leaves

edit flag offensive delete link more


@randomuser Okay but the command just lists the unneeded packages. Do I have to uninstall them manually?

Black_Bucket gravatar imageBlack_Bucket ( 2014-01-02 10:31:50 -0500 )edit

sorry, there is no yum autoremove commander!!!

Charles Wang gravatar imageCharles Wang ( 2014-01-02 18:35:31 -0500 )edit

yum autoremove is a good answer, but it doesn't do anything about the existing leaves, just the ones that would be created at that time. package-cleanup does remove dupes automatically, but it has no way to tell if your leaves are something that you, as a user, are interested in - so yes, you have to manually remove the items on the list. `yum remove $(package-cleanup --leaves) would do, if you've reviewed the whole list.

randomuser gravatar imagerandomuser ( 2014-01-02 22:19:43 -0500 )edit

I usually use yum history. Find the transaction id: 'yum --setopt=history_list_view=commands history' then 'yum history undo ID'

Ahmad Samir gravatar imageAhmad Samir ( 2014-01-04 03:40:37 -0500 )edit

Question Tools



Asked: 2014-01-02 09:49:34 -0500

Seen: 14,054 times

Last updated: Jan 02 '14