Hopefully short version of the question: If I'm on a machine that has a particular package installed, is there a yum command that will tell me which of it's configured repositories provided that package? (Or alternately, what repository would provide a yet-to-be-installed package.)
Background in case some context is needed: We have a maze of yum repositories that we draw from. I have a machine that has a particular rpm package installed, and another machine with an apparently insufficient maze of repositories configured, and so I am not able to install the package I want onto that machine. I need to add the minimal necessary repositories to the new machine. I can't just shotgun the repositories from one machine to the other. And just going out and grabbing the rpm isn't an option because I need this to be reproducible.
Find Packages Details in Repository Now, navigate to /var/lib/apt/lists directory. Then search for the file with the repository name, path and architecture, ends with _Packages in there name. See the content of *_Packages to view details about all packages available under that repository.
Yum Provides Function Yum provides function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the /etc/httpd/conf/httpd.
For example, to display information about the abrt package, type: ~]# yum info abrt Loaded plugins: product-id, refresh-packagekit, subscription-manager Updating Red Hat repositories.
Lists description and summary information about installed and available packages. The info command limits the displayed packages the same way as the list command. This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
yum list packagename
That will show from which repository the package is in the third column of the output.
For already installed packages, that won't work, as the third column shows just "installed". In that case you can do e.g. "rpm -qi packagename", typically the Vendor, Packager and Build Host tags will give an indication to which repository the package belongs. Also it's quite common for some repo symbol being appended to the package version number.
repoquery -i {packagename}
This will give you the actual repo name vs the unhelpful "installed" that yum returns. repoquery is provided by yum-utils.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With