• 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. hwclock Command Examples in Linux
  2. datamash: command not found
  3. Connection using SSH to a Host Not in DNS/hosts Stalls for Some Time at Connection Initiation
  4. macof: command not found
  5. apt: command not found
  6. zcat Command Examples in Linux
  7. “passwd: Module is unknown” – error while changing the password in CentOS/RHEL 6
  8. CentOS / RHEL 7 : systemctl replacements of legacy commands service and chkconfig
  9. pacstrap Command Examples in Linux
  10. ifconfig Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright