How to list packages you have explicitly installed using yum

If you’re after a way to list all the packages you have explicitly installed (rather than packages that have been pulled in as a dependency) then you can do that with yumdb (thanks to Panu on #yum for the tip) which is powered by a new database added in 2009.

List packages you chose to install:
yumdb search reason user

List packages which were installed as deps:
yumdb search reason dep

Let’s go through an example, installing gnash which pulls in a few deps on my system:
Installed:
gnash.x86_64 1:0.8.10-8.fc19
 
Dependency Installed:
agg.x86_64 0:2.5-16.fc19 boost-iostreams.x86_64 0:1.53.0-6.fc19 boost-serialization.x86_64 0:1.53.0-6.fc19 gtkglext-libs.x86_64 0:1.2.0-18.fc18 pangox-compat.x86_64 0:0.0.2-2.fc19

As you can see, I got 5 dependencies, so let’s check whether yumdb got it right:
yumdb search reason dep |egrep "agg|boost-iostreams|boost-serialization|gtkglext-libs|pangox-compat"
 
agg-2.5-16.fc19.x86_64
boost-iostreams-1.53.0-6.fc19.x86_64
boost-serialization-1.53.0-6.fc19.x86_64
gtkglext-libs-1.2.0-18.fc18.x86_64
pangox-compat-0.0.2-2.fc19.x86_64

Yep, looks good. What about gnash?
yumdb search reason user |grep gnash
 
1:gnash-0.8.10-8.fc19.x86_64

Update:
Some people have written in to say the command shows packages that they never explicitly installed, things like ModemManager and firware packages.

I think the reason for this is that yumdb is including default and mandatory packages from when you install a group. I guess that makes sense, if you install a group then you’re telling it you want all of the packages there (but you shouldn’t get any deps).

For example, most systems probably have @hardware-support group installed, which is where ipw220-firmware comes from:
$ sudo yum groupinfo hardware-support |grep ipw2200
=ipw2200-firmware

Similarly, for ModemManager, it’ll be part of default @dial-up group.
$ sudo yum groupinfo dial-up |grep Modem
=ModemManager

So only way around this I can see is to not install groups, because installing a group tells it to install whatever is in the list.

It would be great if yumdb supported “group” type..

-c

15 Responses to “How to list packages you have explicitly installed using yum”


  • Man this is totally awesome! Next time upgrade time comes around, I’m definitely going to be doing this to audit what packages I installed!

  • It’s interesting, but it would more interesting using dnf, do you think so?

  • I see a lot of packages that I didn’t explicitly install. It looks like it is including the default Fedora packages in the list as well?

  • For real?

    yumdb search reason user
    ….
    zd1211-firmware-1.4-6.fc17.noarch
    reason = user
    ….

    I don’t even know what that is, there’s no way in hell I installed that myself. there’s about 500 results to this query on my fc17 system, and there’s no way I manually installed even half of them.

  • Thanks, that is helpful. I had no idea yumdb existed!

  • I modified the query to be:

    $ yumdb search command_line install*

    This returned all packages that I installed, but doesn’t let me filter based on if the packages were explicitly installed or if they were dependencies.

    If only we could include multiple keys in the search…

    (BTW, Hi Chris! I didn’t even realize it was your blog when I posted my first reply :) You were on the Fedora start page for Firefox)

  • This doesn’t seem to work the way I expected. It outputs stuff like:

    ModemManager-0.6.0.0-3.fc18.x86_64
    reason = user

    which I am quite certain I never asked to install, or

    ipw2200-firmware-3.1-7.fc18.noarch
    reason = user

    which makes no sense since I don’t have a wireless card. Maybe it’s treating stuff pre-installed on the LiveUSB as “installed” by the user?

  • Hey Jon, long time no see!

    I think it may be including default and mandatory packages from when you install a group. I guess that makes sense, if you install a group then you’re telling it you want all of the packages there (but you shouldn’t get any deps). Might need some more investigation though..

    Cheers,
    -c

  • I think it may be including default and mandatory packages from when you install a group? I guess that makes sense, if you install a group then you’re telling it you want all of the packages there (but you shouldn’t get any deps). Not 100% sure though..

    -c

  • Could be, although the live image is just copied to the disk to it’ll be the same as whatever packages were specified in the kickstart that created the image.

    My guess is that it’s including default and mandatory packages from when you install a group. I guess that makes sense, if you install a group then you’re telling it you want all of the packages there (but you shouldn’t get any deps). For example, I’m sure that your system will have installed @hardware-support which is where ipw220-firmware came from:
    $ sudo yum groupinfo hardware-support |grep ipw2200
    =ipw2200-firmware

    Similarly, for ModemManager, it’ll be part of default @dial-up group.
    $ sudo yum groupinfo dial-up |grep ModemThere is no installed groups file.
    =ModemManager

    So only way around this I can see is to not install groups, cause installing a group tells it to install whatever is in the list.

    -c

  • Ah, but I didn’t install @hardware-support or @dial-up. They were installed by default on the LiveUSB though.

  • You might not have yourself, but you installed the system which did, so you “did” :-)

    -c

  • It appears that yumdb is part of yum-utils:

    yum -y install yum-utils

    :)

  • You are a rock star! thanks!

Leave a Reply