Introduction
On "Enterprise Linux" variants--CentOS, CloudLinux, AlmaLinux, and RockyLinux--you can utilize the 'yum' utility to manage RPM packages installed on the system. The 'history' sub-command will report information on recent installations and updates.
Procedure
The base 'yum history' command will display a list of recent "transactions" yum has recorded:
yum history
Loaded plugins: fastestmirror, universal-hooks
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
63 | System <unset> | 2022-12-21 09:34 | E, U | 115 EE
62 | root <root> | 2022-12-08 00:21 | Update | 1 EE
61 | root <root> | 2022-11-29 06:24 | Update | 1 EE
60 | root <root> | 2022-10-22 12:13 | Install | 1
59 | root <root> | 2022-10-01 07:52 | E, I, U | 152 E<
58 | root <root> | 2022-08-25 05:06 | Update | 1 >E
57 | System <unset> | 2022-06-30 11:14 | Install | 1 P<
56 | root <root> | 2022-06-30 10:59 | E, I, U | 168 ><
55 | root <root> | 2022-06-29 04:41 | Update | 1 >E
54 | root <root> | 2022-06-17 08:40 | Install | 1 EE
53 | root <root> | 2022-06-09 02:34 | Update | 1 EE
52 | root <root> | 2022-05-29 05:05 | Update | 1 EE
51 | root <root> | 2022-05-27 05:49 | I, U | 12 EE
50 | root <root> | 2022-04-19 04:04 | Update | 1 EE
49 | System <unset> | 2022-04-17 06:09 | Install | 2 EE
48 | root <root> | 2022-04-13 06:21 | Update | 4 PP
47 | root <root> | 2022-04-13 04:59 | E, I, U | 152 **
46 | root <root> | 2022-03-31 06:51 | Install | 1 <
45 | root <root> | 2022-03-23 03:10 | Update | 1 >E
44 | System <unset> | 2022-03-03 12:42 | I, U | 6
As shown above, we have the yum transaction ID, the user who called yum, the date and time yum was called, and what actions were applied by the transaction.
You can also use pul up the history with yum for a particular package. For instance, if we want to look at the summary on the ea-php73 package, we can use this sub-command:
yum history summary ea-php73-php-cli
Loaded plugins: fastestmirror, universal-hooks
Login user | Time | Action(s) | Altered
-------------------------------------------------------------------------------
System <unset> | Last 3 months | E, U | 115
root <root> | Last 6 months | E, I, U | 152
System <unset> | Last year | Update | 97
root <root> | Last year | E, I, U | 502
root <root> | Over a year ago | I, U | 446
This output is slightly different, showing the user who requested the transaction, the time the transaction occurred, the actions taken during the transaction, and the number of altered packages; but does not display the transaction ID.
You can use the info sub-command with the package you want to check for deeper detail. This lists if a package was updated or installed, what packages were installed alongside it, and any logs created.
yum history info mariadb-server
--- cut to allow smaller output ---
Transaction ID : 43
Begin time : Thu Mar 3 12:41:22 2022
Begin rpmdb : 1796:f8d3629dcd395ee498f7c0abbd067d04f95244c5
End time : 12:41:56 2022 (34 seconds)
End rpmdb : 1803:d7d230a720ec5e94301de185247f4349bc64d912 **
User : System <unset>
Return-Code : Success
Command Line : --assumeyes --color=never --config /etc/yum.conf install MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared MariaDB-common MariaDB-compat --enablerepo=epel
Transaction performed with:
Installed rpm-4.11.3-48.el7_9.x86_64 @updates
Installed yum-3.4.3-168.el7.centos.noarch @base
Installed yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch @base
Packages Altered:
Install MariaDB-client-10.2.43-1.el7.centos.x86_64 @MariaDB102
Install MariaDB-common-10.2.43-1.el7.centos.x86_64 @MariaDB102
Install MariaDB-compat-10.2.43-1.el7.centos.x86_64 @MariaDB102
Install MariaDB-devel-10.2.43-1.el7.centos.x86_64 @MariaDB102
Install MariaDB-server-10.2.43-1.el7.centos.x86_64 @MariaDB102
Install MariaDB-shared-10.2.43-1.el7.centos.x86_64 @MariaDB102
Dep-Install galera-25.3.35-1.el7.centos.x86_64 @MariaDB102
Scriptlet output:
1 warning: /etc/my.cnf created as /etc/my.cnf.rpmnew