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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. LVM Commands Fail With “Failed to load config file /etc/lvm/lvm.conf”
  2. How to use ‘yum’ to connect ULN on CentOS/RHEL/OEL 6
  3. Kernel Logs Warning Messages “kernel: Possible SYN flooding on port X. Sending cookies” is logged”
  4. How to activate a “SUSPENDED” LVM physical volume
  5. CentOS / RHEL 7 : systemd-analyze command to find booting time delays
  6. Common Init.ora Parameters and Unix, Linux Kernel Parameters and Relationship Between Them
  7. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  8. How to backup Linux OS using “dd” Command
  9. How to use shell aliases in Linux
  10. “mlock failed: Cannot allocate memory” lvcreate command error in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary