How to list recent yum updates

8

2

Last night I have updated one of my RedHat systems from 6.1 to 6.2. There were a few hundred updates.

How can I list the recent updates that was applied to my system? I have tried yum list recent but that only shows

Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
Recently Added Packages
Red_Hat_Enterprise_Linux-Release_Notes-6-as-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-bn-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-de-DE.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch                 2-22.el6_2                 rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-es-ES.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-fr-FR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-gu-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-hi-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-it-IT.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ja-JP.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-kn-IN.noarch                 2-8.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ko-KR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ml-IN.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-mr-IN.noarch                 2-10.el6_2                 rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-or-IN.noarch                 2-5.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-pa-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-pt-BR.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-ru-RU.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-te-IN.noarch                 2-7.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-zh-CN.noarch                 2-6.el6_2                  rhel-x86_64-server-6
Red_Hat_Enterprise_Linux-Release_Notes-6-zh-TW.noarch                 2-4.el6_2                  rhel-x86_64-server-6
rng-tools.x86_64                                                      2-13.el6_2                 rhel-x86_64-server-6

Dejan

Posted 2011-12-09T15:56:44.840

Reputation: 914

Answers

8

This should do it.

rpm -qa --qf '%{INSTALLTIME} %-40{NAME} %{INSTALLTIME:date}\n' | sort -n | cut -d' ' -f2-

That queries all your installed RPM packages (rpm -qa) and prints them using a format (--qf) with the time of installation first in seconds since the epoch(%{INSTALLTIME}), then the name of the package in a 40 character field, left justified (%-40{NAME}), then the installation time as a date and time (%{INSTALLTIME:date}). The result is sorted by the first time field, then that time field is removed.

garyjohn

Posted 2011-12-09T15:56:44.840

Reputation: 29 085

10It appears that this causes the same output rpm -qa --last – Dejan – 2011-12-09T18:53:25.127

4

Just this should show you plenty (show last 30):

rpm -qa --last | head -30

Mike Q

Posted 2011-12-09T15:56:44.840

Reputation: 159