Introduction
Yum is for installing packages on the server to give it extra features. This article will cover how to use yum's history command to go through and see when packages were installed or updated.
Procedure
Let's begin with the basic syntax of yum history and its flags. Each of these will have a different output of the yum history depending on the flag used. There are more, but the ones above are usually the most common.
For `yum history` command, we have this output:
# 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 ID, what user ran yum, the date and time, and what actions were taken.
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 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
You can use the info flag 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