Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can yum tell me which of my repositories provide a particular package?

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.

like image 943
Brian Deacon Avatar asked Mar 11 '09 18:03

Brian Deacon


People also ask

How can I see what packages are available in my repository?

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.

What is the yum option to find software package information?

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.

How do we get info about specific packages in Red Hat Linux?

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.

What information is displayed by the command yum info kernel?

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.


2 Answers

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.

like image 52
janneb Avatar answered Sep 28 '22 03:09

janneb


repoquery -i {packagename}  

This will give you the actual repo name vs the unhelpful "installed" that yum returns. repoquery is provided by yum-utils.

like image 23
8None1 Avatar answered Sep 28 '22 05:09

8None1