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")?
CentOS / RHEL / Fedora 22 or earlier
yum list installed | grep @epel
Fedora 23 or later
dnf list installed | grep @epel
dnf repo-pkgs epel list installed
+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