Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

How can I get a list of all of the RPM packages that have been installed on my system from a particular repo (e.g., "epel")?

share|improve this question
up vote 16 down vote accepted
yum list installed | grep @epel
share|improve this answer
dnf repo-pkgs <repoid> list installed


The command above uses DNF to list the packages installed from the <repoid>. Note repo-pkgs is just an alias of repository-packages.

From the man pages:

man dnf | grep "repository-packages.*list.*installed" -A 1

Further reading:

man dnf
share|improve this answer
I'll let this one slide because it is a correct answer, but you'd get more upvotes if you explained how the command works. – Shadur Oct 5 '15 at 8:20
@Shadur: you think now is better? – Peque Oct 5 '15 at 8:44
Much better, thanks. – Shadur Oct 5 '15 at 8:45

As of RHEL6, as suggested in this stackoverflow answer, there's a more thorough method of doing this with yumdb:

yumdb search from_repo REPOID*

The repoid takes wild cards.


If we're going to cheat and pipe the output, then we can achieve pretty-print effect as well. Here's one using awk

yumdb search from_repo REPOID* |awk -F"\n" '{ RS=""; print $1 }'

Using egrep or grep -e

yumdb search from_repo REPOID* |egrep -v '(from_repo|^$)'


To list all available packages in a specified repository, do:

repoquery -qa --repoid=REPONAME
share|improve this answer
Just a side-note: To list all packages from a specified repo, do repoquery -qa --repoid=REPONAME – ILMostro_7 Dec 15 '14 at 1:44
This is also a great answer. The output is longer than the accepted answer, but it's formatted in a nicer way. – Routh Jun 15 '15 at 10:31

Grepping yum's output is the most obvious way:

yum list installed | grep @epel

However, you can't display extra packages properties and it's difficult to parse with a script. The tool repoquery from the package yum-utils is the tool, but it isn't installed by default.

repoquery -a --installed --qf "%{ui_from_repo} %{name}" | grep '^@epel'

and a more complex example:

repoquery -a --installed --qf "%-20{ui_from_repo} %-30{name} %-7{arch} %{epoch}:%-12{version} %-4{release}" | grep '^@epel'
share|improve this answer

You could check the Vendor header of installed rpms.

This example lists all package from VideoLAN repository:

 rpm -q -a --qf "%{Name}:%{Vendor}\n" \
     | grep -F ":VideoLAN Project (http://www.videolan.org)"

Obviously, you need to determine if the Vendor header of your repository is unique among different repositories.

share|improve this answer
There isn't a one-to-one mapping between Vendor and repos, and in some cases, the Vendor string is blank. – Lorin Hochstein Oct 13 '11 at 16:36

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.