Linux – List installed, top-level packages in Fedora

fedoralinuxyum

I used to use yum to list all installed packages:

yum list installed

Now I need to list top level packages only i.e. if a package is a dependency of another, it should not be shown. GNOME's Add/Remove Software can do this but I need the output in a terminal.

I checked yum manual but I could not find a switch for that.

Best Answer

You can use the tool package-cleanup which is part of yum-utils. Besides finding packages which are not available from the current yum repositories, finding packages with broken dependencies, pruning old kernels and finding duplicate packages it can also find packages on which no other packages depend. Those are called leaves. Do

yum install yum-utils

to get package-cleanup and

package-cleanup --leaves --all

to get a list of all leaves.

Related Question