After I have installed a package by yum (with multiple repositories configured), how can I find from which repository it has been installed?
If I run yum info package-name
(or yum list package-name
), I can only see that the package is "installed".
With
yum-utils
installed,repoquery
will provide the information you seek (here 'epel' being the repository).What version of yum?
On the current version if the installed package is the same version as the most recent one available then the repo it was installed from is shown.
If there is a newer package available, then it will be shown separately, with the new version showing the repo it's available from.
Coming way to late but (at least on Fedora 15) one can use yumdb for similar queries:
And what I actually needed to list packages from given repo(s):
If all else fails, you can inspect the yumdb manually. It's located in
/var/lib/yum/yumdb
and contains detailed information on every installed package. You'll be particularly interested infrom_repo
. For example, for thebind-utils
package:To get just the information you want:
Later versions will provide even more data; for instance in EL 7 the exact mirror and URL from which the package was downloaded is stored here.
Will tell you the vendor and packager
To see what installed from repo epel: (Should work under Centos 5.5) note, if you have no repo named epel, it will spit out everything installed.
The simplest and most straightforward approach without installing any extra tools, greping or outputting extraneous information is simply:
The third column will provide the ID of the repository the package was installed from.
This was mentioned in a comment on the original question using grep, but that's not necessary. You can just pass the package name directly to
yum
to filter.If the package was installed recently, you can look in /var/cache/yum.
Within that directory, there is a directory for each repo, and in that a packages directory. So, you would do something like:
However, cache has to be enabled in your /etc/yum.conf file:
Note that a
yum clean [packages|all]
will clear out the cache directory.If the cache directory is empty, there is an alternative way. The information that is read by
yum info [package]
comes from /var/cache/yum/[repo]/primary.xml.gzYou can look through the file by entering:
However, on machines where
yum info [package]
does not display "From repo : ", as indicated by 'theotherreceive', it is because it is not in the file primary.xml, so there will be no way to retrieve that information. Therefore, if the package is in two or more primary.xml files, you will have to determine the repo priority on you system.Based on and answer by Swoogan
On RedHat and CentOS one can do
The results should look something like
Where repository_name is the repository where your package can be found, and it was probably installed from the first one in a list (see yum repolist)
So I know this is a somewhat old question - but it comes up on the google search for what I was looking for.
There is also a method to get a unique list of repos used:
This will list the repositories that have had packages installed from.