how to find out when the latest rpms were installed

Posted on October 9, 2009. Filed under: Uncategorized | Tags: , |

Some time ago I ran into a problem where suddenly nothing seemed to work any more on a given Linux machine. At least not those services which needed to run there. One suspicion was whether software was updated. One way to find this out is by querying the rpm install dates:

   rpm -qa --queryformat '%{INSTALLTIME} %{NAME}\n' | sort -nr | head

This shows the latest rpms installed on top. As I recognized the top ones that I installed myself a few days before, I knew that there were no rpms upgraded or installed which could be the origin of the problem I was seeing. The above command prints the install dates in unix time, quite unreadable to humans. To convert the times to human readable format, I used:

 rpm -qa --queryformat '%{INSTALLTIME} %{NAME}\n' | sort -nr | head | perl -ne '@words = split; print localtime($words[0]) . " : $words[1]\n"'

(Note that to use the correct ‘punctuation signs’ here is very important..)

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: