• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to find RPM installation date and time

by admin

You can use the following command to display the install date and time of all the packages installed on your system:

rpm -qa --last

For example :

# rpm -qa --last | more
aide-0.14-11.el6.x86_64                       Tue 22 Aug 2017 12:57:07 AM IST
tzdata-java-2017b-1.el6.noarch                Tue 22 Aug 2017 12:27:22 AM IST
trace-cmd-2.2.4-4.el6.x86_64                  Tue 22 Aug 2017 12:27:22 AM IST
ql2500-firmware-7.03.00-1.el6_5.noarch        Tue 22 Aug 2017 12:27:22 AM IST
hal-info-20090716-5.el6.noarch                Tue 22 Aug 2017 12:27:22 AM IST
zip-3.0-1.el6_7.1.x86_64                      Tue 22 Aug 2017 12:27:21 AM IST
........

You can grep for a specific rpm name and find out the time of installation only for that particular package. For example to find the installation time of all packages with string kernel in them (Returns the install date and time for all packages with kernel in their name, such as the kernel, kernel-utils, etc.):

# rpm -qa --last | grep kernel
dracut-kernel-004-409.el6_8.2.noarch          Tue 22 Aug 2017 12:26:53 AM IST
libreport-plugin-kerneloops-2.0.9-33.el6.x86_64 Tue 22 Aug 2017 12:26:23 AM IST
abrt-addon-kerneloops-2.0.8-43.el6.x86_64     Tue 22 Aug 2017 12:26:23 AM IST
kernel-2.6.32-504.el6.x86_64                  Fri 15 Aug 2014 10:00:46 PM IST
kernel-firmware-2.6.32-504.el6.noarch         Fri 15 Aug 2014 10:00:42 PM IST
kernel-headers-2.6.32-504.el6.x86_64          Fri 15 Aug 2014 09:58:41 PM IST

For information about a specific package, specify the package_name in the command:

# rpm -q --last [package_name]

For example, you can use this command to look at the Firefox package installation time :

# rpm -qa --last firefox
firefox-52.2.0-1.el6_9.x86_64                 Tue 22 Aug 2017 12:27:05 AM IST

Formatting the output

We can also format the output of the “rpm -qa –last” command as per our needs. For example you can list the installation time for Firefox RPM

# rpm -qa --queryformat '(%{installtime:date}) %{name}\n' firefox
(Tue 22 Aug 2017 12:27:05 AM IST) firefox

You can get a list of –queryformat Tags here.

Filed Under: Linux

Some more articles you might also be interested in …

  1. ac Command Examples in Linux
  2. CentOS / RHEL 6 : How to disable telnet service
  3. LVM error “WARNING: Inconsistent metadata found” – How to resolve in CentOS / RHEL
  4. How to disable IPv6 on CentOS / RHEL 5
  5. How to change the number of commands stored in Bash History
  6. “java” command does not run the JVM that has been installed
  7. How to Re-Create the Yum Cache and/or Force a Fetch of the Package List of the Enabled Repositories
  8. Understanding the job control commands in Linux – bg, fg and CTRL+Z
  9. The System Activity Reporter (sar) Command in Linux
  10. How to configure iSCSI Initiator (client) in CentOS / RHEL 6

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright