CentOS / RHEL : How to view the commands executed in yum history command output

By default when you execute yum history command, you would only see the time and actions (update, install etc.) for the yum packages.

# yum history
.....
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    22 |  [user1]                | 2017-07-19 21:45 | I, U           |  279 EE
    21 |  [oracle]                | 2017-07-08 14:36 | Install        |    1
    20 |  [oracle]                | 2017-07-08 14:36 | Install        |    1 EE
    19 |  [oracle]                | 2017-07-08 14:35 | Install        |    1 EE
    18 |  [oracle]                | 2017-07-08 00:32 | Install        |    1

To also view the yum commands executed in the out put we need to add history_list_view=cmds entry to /etc/yum.conf file. By default, this parameter is not added in the yum configuration file.

# vi /etc/yum.conf
history_list_view=cmds

If you now check, you can find the commands like “install, update” in the second column. You would also get the options used with the command like –exclude.

# yum history
....
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    22 | --exclude=kernel*,*relea | 2017-07-19 21:45 | I, U           |  279 EE
    21 | install oracleasmlib-2.0 | 2017-07-08 14:36 | Install        |    1
    20 | install kmod-oracleasm-2 | 2017-07-08 14:36 | Install        |    1 EE
    19 | install oracleasm-suppor | 2017-07-08 14:35 | Install        |    1 EE
    18 | install compat-libcap* - | 2017-07-08 00:32 | Install        |    1
Related Post