Unix & Linux
fedora rhel yum rpm dnf
Updated Sat, 23 Jul 2022 14:08:28 GMT

List all RPM packages installed from repo "X"


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")?




Solution

CentOS / RHEL / Fedora 22 or earlier

yum list installed | grep @epel

Fedora 23 or later

dnf list installed | grep @epel

RHEL8

dnf repo-pkgs epel list installed




Comments (5)

  • +0 – This will not work. Yum will output lines to the pipe that will be broken if they get too long. So grep's input is mostly one line per package, but it could be two lines. Yum could pass "whizbanger.x86_64 ___ 3.8.4-2.el6 _______________ @epel". (Imagine the underscores as spaces.) The "@epel" is on the next line of the input grep sees. So grep is going to output that line with nothing but "@epel" but not the preceding line with the package name. — Mar 07, 2017 at 16:09  
  • +0 – You may need to run those commands as root until bugzilla.redhat.com/show_bug.cgi?id=1525645 is fixed. — Dec 13, 2017 at 19:27  
  • +0 – the yum command doesn't seem to work if one the repos is having issues. i needed this list to see if i wanted to disable the repo with issues. — Jun 11, 2018 at 02:22  
  • +0 – @Todd Watson I know, it is a hack, but what about "export COLUMNS=999 yum..." — Aug 20, 2018 at 20:01  
  • +0 – Does that work, @Massimo? That would be a nice workaround. I found also this Unix StackExchange question: unix.stackexchange.com/questions/308731/… — Aug 20, 2018 at 21:14