Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

4 Answers 4

up vote 11 down vote accepted
yum list installed | grep @epel
share|improve this answer

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.


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

 
discard

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.