Friday, January 09, 2015

Query latest updates in Linux via RPM (YUM)

rpm -qa --qf '%{INSTALLTIME} %{INSTALLTIME:date}: %-40{NAME} %{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n  | cut -d' ' -f2-
{InstallTime:Date}               {NAME}                                   {VERSION}-{RELEASE}.{ARCH}
...
Fri 09 Jan 2015 11:08:56 AM EST: ntp                                      4.2.6p5-2.el6_6.x86_64
Fri 09 Jan 2015 11:09:00 AM EST: mailx                                    12.4-8.el6_6.x86_64
Fri 09 Jan 2015 11:09:06 AM EST: jasper-libs                              1.900.1-16.el6_6.2.x86_64

This 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}). The result is sorted by the first time field, and then that time field is removed.

%-40{NAME} Package Name (40 characters, left justified)
%{VERSION} Version
%{RELEASE} Release
%{ARCH} Architecture (e.g. 64 bit or 32 bit)

2 comments:

web lol said...

kul post

anjani02 said...

Online Business Analyst Classes
Join live online Business Analyst classes to enhance your analytical thinking, documentation, and communication skills. Gain certification and placement assistance to start your BA career.