Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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".

share|improve this question
Great question! I installed yum-utils and tried one it's utils called repoquery, but no luck. – Sean Staats Sep 3 '09 at 15:33
see also… :) – warren Dec 3 '09 at 12:43

11 Answers 11

up vote 54 down vote accepted

With yum-utils installed, repoquery will provide the information you seek (here 'epel' being the repository).

└─[$]> repoquery -i cherokee

Name        : cherokee
Version     : 0.99.49
Release     : 1.el5
Architecture: i386
Size        : 8495964
Packager    : Fedora Project
Group       : Applications/Internet
URL         :
Repository  : epel
Summary     : Flexible and Fast Webserver
Description :
Cherokee is a very fast, flexible and easy to configure Web Server. It supports
the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL
encrypted connections, Virtual hosts, Authentication, on the fly encoding,
Apache compatible log files, and much more.
share|improve this answer
repoquery does not seem to work right, i get different package versions then yum info package_name, it does not seem to query the repositories in the same order as yum. – Mike Miller Nov 30 '10 at 16:38
Same here on a few servers. yum info package_name returns more results than repoquery apparently. This is why stack exchange should not lock in votes. – reflexiv Dec 18 '12 at 5:51
I found Xiong Chiamiov's answer not correct. repoquery -i $pkg gives repo from which a $pkg is available, not the repo from which the $pkg was installed. I did that command and rpm -qi $pkg and got different version numbers. rpm resulted in an earlier version number than that of repoquery. – user158844 Feb 13 '13 at 18:48
It's possible your local copy is out-of-date, or it was installed with additional commands to yum (e.g. --use-mirror). I don't think it's possible to always get the right answer. – Xiong Chiamiov Oct 5 '13 at 4:12

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.

$ yum info irssi
Installed Packages
Name       : irssi
Arch       : i586
Version    : 0.8.14
Release    : 1.fc11
Size       : 2.3 M
Repo       : installed
From repo  : updates
Summary    : Modular text mode IRC client with Perl scripting
URL        :
License    : GPLv2+
Description: Irssi is a modular IRC client with Perl scripting. Only text-mode
           : frontend is currently supported. The GTK/GNOME frontend is no
           : longer being maintained.

$ yum --version

If there is a newer package available, then it will be shown separately, with the new version showing the repo it's available from.

share|improve this answer
I'm using yum 3.2.19 on CentOs 5.3 and "From repo" row doesn't exist. – lg. Sep 3 '09 at 16:29
Yep...I was testing it on 3.2.21, which doesn't have that info anywhere. When I did it on my box that has 3.2.23, it worked. – Alex Sep 3 '09 at 17:00
Now this is the best solution, but not applicable for RHEL/Centos 5.3. I accept this solution, but I ready to choose another answer if will be applicable also for RHEL/Centos 5.3. – lg. Sep 4 '09 at 7:38
This is a no-go in CentOS 5.5 either. – Mike Miller Nov 30 '10 at 16:38
"From rep" is not available even in centos 5.8 – sepehr Apr 7 '13 at 16:53

Coming way to late but (at least on Fedora 15) one can use yumdb for similar queries:

yumdb info 'python*'

And what I actually needed to list packages from given repo(s):

yumdb search from_repo 'my-*-repo'
share|improve this answer
It works also on Fedora 14 – lg. Oct 28 '11 at 7:22
works on RHEL 6.2 – pixelbeat Nov 8 '11 at 17:43

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:

find /var/cache/yum -name [package-name]*

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.gz

You can look through the file by entering:

gunzip -d -c /var/cache/yum/[repo]/primary.xml.gz | grep '<name>[package]'

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.

share|improve this answer
This solution maybe an option (I vote it), but I am looking for a definitive answer. – lg. Sep 4 '09 at 7:34

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 in from_repo. For example, for the bind-utils package:

# for i in /var/lib/yum/yumdb/b/*bind-utils*/*; do echo $i: `cat $i`; done
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/checksum_data: 39f7840f93d3d76825a9e8da79cfe0366f7fad68f018a273477aee62cccfa3f4
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/checksum_type: sha256
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/command_line: install bind-utils
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/from_repo: updates
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/from_repo_revision: 1397654451
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/from_repo_timestamp: 1397654759
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/installed_by: 0
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/reason: user
/var/lib/yum/yumdb/b/73ea08770fa666e18c59842bf65fa0f3a0b103d8-bind-utils-9.8.2-0.23.rc1.el6_5.1-x86_64/releasever: 6

To get just the information you want:

# cat /var/lib/yum/yumdb/b/*bind-utils*/from_repo

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.

share|improve this answer
+1. But it's even better to do something like: for i in /var/lib/yum/yumdb/b/*bind-utils*/*; do echo $i: `cat $i` | grep -oP 'from_repo:\ \K.*'; done, which in the above example returns: updates - much more readable! – Greg Dubicki Jan 27 at 21:10
@GregDubicki The point of the command was to show more of the context of what is going on and how things are stored. It apparently failed to do so: There is no need to grep anything here, and you can even drop the loop. A very simple cat /var/lib/yum/yumdb/b/*bind-utils*/from_repo is all you need. – Michael Hampton Jan 27 at 21:14

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 every thing installed.

repoquery --repoid=epel -a | xargs yum list installed

share|improve this answer
This appears to work as long as there isn't an updated package in the repository. So you need to run yum update just before using it. – codewaggle May 29 '12 at 9:22

Based on and answer by Swoogan
On RedHat and CentOS one can do

sudo grep -ir PACKAGE_NAME /var/cache/yum/

The results should look something like

Binary file /var/cache/yum/REPOSITORY_NAME/primary.xml.gz.sqlite matches

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)

share|improve this answer

Is that information captured anywhere? The package doesn't have that information, and yum doesn't care after it finds the package. You could probably piece it together by figuring out what repos have the package and then determine which one has priority.

share|improve this answer
This solution maybe an option (I vote it), but only for recent installed package, because I can change the repository and their priority. – lg. Sep 4 '09 at 7:31

Not a great solution, but I found that yum list available will show you where the most up to date version of each package is available, e.g.:

yum list available | grep gstreamer

PackageKit-gstreamer-plugin.x86_64 0.3.16-1.fc10          updates

bluez-gstreamer.i386 4.30-2.fc10 updates
gstreamer.i386 0.10.21-2.fc10 fedora
gstreamer-devel.i386 0.10.21-2.fc10 fedora
gstreamer-devel.x86_64 0.10.21-2.fc10 fedora
gstreamer-plugins-bad-devel.i386 0.10.9-1.fc10 rpmfusion-free
gstreamer-plugins-bad-devel.x86_64 0.10.9-1.fc10 rpmfusion-free

So you could do a yum list available on your package, then compare your installed version using yum list installed, and have a good idea of which repo it came from if the versions match.

share|improve this answer
This is true only is the package is not yet installed. – lg. Sep 4 '09 at 7:20
While it doesn't answer the OPs question exactly, it was very helpful for me because it works in Centoss 5.5 with just yum and no other utils, and you can: 1. Uninstall the package then query to see where the repo is then reinstall, or 2. Query on a different machine without the package installed. – lreeder Dec 4 '14 at 4:09
rpm -qi packagename

Will tell you the vendor and packager

share|improve this answer

The easiest way is this:

rpm -qa --qf '%{NAME} %{VENDOR}\n'

More tips and tricks are available here:

share|improve this answer
In this way (adding a pipe whith grep -i package name) I discover the vendor, but not the repository. – lg. Feb 7 '11 at 7:43
The vendor has (almost) nothing to do with the repository. – Matteo Jul 20 '12 at 7:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.