Today I learned from my coworkers about a few helpful sub commands of yum and some other things from the rpm world. Just jotting them down here so I don't forget about them.
Oh and why did we've to do it? Well CentOS 6 got a grep update from 2.6 to 2.20. That upgrade lost the --mmap option and some very old stuff started to fall apart because of the now unknown option. Update: There are some interesting issues related to this update in the RedHat Bugzilla. #1287074 #1256756 I added #1291714 just for the sake of completeness.
# yum history
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
124 | xxx | 2015-12-15 11:51 | Downgrade | 1
123 | yyy | 2015-12-15 11:02 | E, O, U | 244 EE
122 | zzz | 2015-12-15 10:57 | I, O, U | 255 **
Provides an overview of the last actions done with yum. On CentOS 7 (this one is from CentOS 6) the output seems to have changed slighty and it provides the commandline instead of the username.
# yum list installed | grep epel
bash-completion.noarch 1:1.3-7.el6 @epel-Mirror
eventlog.x86_64 0.2.13-1.el6 @epel-Mirror
libnet.x86_64 1.1.6-7.el6 @epel-Mirror
pylint.noarch 1.3.1-1.el6 @epel-Mirror
python-astroid.noarch 1.2.1-2.el6 @epel-Mirror
python-logilab-common.noarch 0.62.1-2.el6 @epel-Mirror
python-unittest2.noarch 0.5.1-3.el6 @epel-Mirror
Helps you to find out from which repository you installed which package.
# repoquery -i grep
Name : grep
Version : 2.20
Release : 3.el6_7.1
Architecture: x86_64
Size : 1197808
Packager : CentOS BuildSystem <http://bugs.centos.org>
Group : Applications/Text
URL : http://www.gnu.org/software/grep/
Repository : update
Summary : Pattern matching utilities
Source : grep-2.20-3.el6_7.1.src.rpm
Description : [ ... ]
Kind of the rpm -q ... stuff on a repository level instead of the local rpm database.
Update: T.P. provided a small shell snippet to show updates. Thanks.