How To Query Which Yum Package Groups A Particular Package Is Member Of

Home » CentOS » How To Query Which Yum Package Groups A Particular Package Is Member Of
CentOS 11 Comments

I’m trying to find out how dnsmasq got on my CentOS 7 system, since I use BIND for DNS. I’m guessing it was part of a base group that Anaconda installs for all systems.

Red Hat has this answered on this page but the answer is only available to subscribers. I’m guessing this kind of content will be available to us once the new free subscription thing starts.

11 thoughts on - How To Query Which Yum Package Groups A Particular Package Is Member Of

  • Here’s how to find the package for a particular file:

    # ls /{bin,sbin}/dns*
    /bin/dnsdomainname /sbin/dnssec-coverage /sbin/dnssec-keyfromlabel
    /sbin/dnssec-revoke /sbin/dnssec-verify
    /sbin/dnsmasq /sbin/dnssec-dsfromkey /sbin/dnssec-keygen
    /sbin/dnssec-settime
    /sbin/dnssec-checkds /sbin/dnssec-importkey /sbin/dnssec-keymgr
    /sbin/dnssec-signzone
    # yum provides /sbin/dnsmasq Loaded plugins: fastestmirror, langpacks, priorities Loading mirror speeds from cached hostfile
    * CentOS-sclo-rh: mirror.freethought-internet.co.uk
    * CentOS-sclo-sclo: mirror.freethought-internet.co.uk
    * elrepo: mirrors.coreix.net
    * nux-dextop: mirror.li.nux.ro dnsmasq-2.76-16.el7_9.1.x86_64 : A lightweight DHCP/caching DNS server Repo : @updates Matched from:
    Filename : /sbin/dnsmasq

  • probably from virtualization if it is there.. but a way to check is

    repoquery –whatrequires dnsmasq

    Red Hat has this answered on this page but the answer is only available to

  • –That one’s easy and I use this all the time:

    rpm -qf full-file-name

    I’m looking for how to get the yum group for a package. (I’m guessing a package might even be in more than one group?) That would help explain how the dnsmasq package got installed on my system. (It was never enabled by systemd and isn’t required by any other package. So I went ahead and erased it to free the space and reduce my attack surface.)

  • or one can look for the comps file in /var/cache/yum

    network-tools has dnsmasq listed as a package

    repoquery says the following on my rhel box NetworkManager-1:1.4.0-20.el7_3.x86_64
    libvirt-daemon-driver-network-0:4.5.0-36.el7_9.3.x86_64

  • –Aha! It’s actually in network-server (“Network Infrastructure Server”)
    group. network-tools is the next one in the comps.xml file. The group name sounds like something I might have wanted for my application, but the contents are really for a lightweight server like one finds in a consumer router.

    But, except for dhcp and radvd, none of the other packages in that group are installed, so I still don’t see how I got dnsmasq on my system. Here’s the network-server package list:

    dhcp dnsmasq freeradius quagga radvd rsyslog-gnutls rsyslog-gssapi rsyslog-kafka rsyslog-mysql rsyslog-pgsql rsyslog-relp syslinux syslinux-tftpboot tang tftp-server
  • How about using yum history to find when and why the package was installed?

    yum history summary dnsmasq yum history package-list dnsmasq

    Jamie

  • –Very nice!

    The oldest record of the second command:

    1 | Dep-Install | dnsmasq-2.66-12.el7.x86_64

    I’m guessing that means it was a dependency for something back then. Is there a way to discover what? Using “yum history info 1” I see that this was the original Anaconda install from 2014. Could dnsmasq be in the original minimal disk installer?

  • Try `yum remove –assumeno dnsmasq` and see what it wants to remove. On my system I get

    –> Processing Dependency: dnsmasq >= 2.41 for package: libvirt-daemon-driver-network-4.5.0-36.el7_9.3.x86_64

    Jim

  • –That I tried at the beginning but it turned up nothing, which is why I was mystified. I suspect whatever depended on it before has lost the dependency in a later version, or I removed it long ago.