List packages by install date

A handy ‘one liner’ that lists all the packages installed on a RedHat system by the install date.

rpm -qa --qf $'%{INSTALLTIME}\t%{INSTALLTIME:date}\t%{NAME}\n' | sort -n -r -k1 | cut -f2,3
Sun 09 Jun 2019 17:26:04 BST systemd-sysv
Sun 09 Jun 2019 17:26:04 BST systemd-libs
Sun 09 Jun 2019 17:26:04 BST rsync
  :
  :
  :
Thu 02 Nov 2017 12:49:32 GMT bzip2-libs
Thu 02 Nov 2017 12:49:13 GMT fontpackages-filesys
Thu 02 Nov 2017 12:49:13 GMT basesystem

This command uses format specifier to display the installed packages with a numeric date/time in the first field, a descriptive date/time in the second field, and the package name in the third field, all separated by tabs. The output is then sorted into date order using the numeric date field, and then just the second and third fields are displayed.

Note – You don’t need to specify a delimiter the output is formatted with tab between the fields which is the default delimiter used by sort and cut.

Advertisements
This entry was posted in RedHat and tagged . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.