Sometimes, we might need to find the last patched date on Solaris server for PCI compliance requirement. Many organizations are started using the configuration management tools to capture last patched date or maintenance date. But in a legacy environment, we might need to do the reverse engineering to identify last patched date for the server. Let’s find the last patched date on Oracle Solaris server.
Oracle Solaris 11:
1.Login to the server as root user. In Solaris 11, there is no classification for packages or patches. It does just package upgrade on every update for fixes.
2. Run the following to command to find the last installed packages/patches.
root@solaris 11.3# ls -lrt /var/sadm/pkg |tail drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWsshu drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWnisr drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWnisu drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWnfsskr drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWnfssr drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWnfssu drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWbash drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWroute drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWroutr drwxr-xr-x 2 root root 3 Apr 13 14:39 SUNWgtar root@solaris 11.3:~#
3. Get the installed date for the patches/packages listed above.
root@cgissc02-appadm02:~# grep -h INSTDATE /var/sadm/pkg/SUNW*/pkginfo | sed -e 's/From:.*//' |grep 2018 |head INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:37 INSTDATE=Apr 13 2018 14:37 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 INSTDATE=Apr 13 2018 14:39 root@cgissc02-appadm02:~#
Just change the year in the grep command if you don’t get any output.
Oracle Solaris:10
1. Login to Oracle Solaris 10 server.
2. Run the following command to know the patched date and patch number.
bash$ Solaris 10> grep -h PATCH_INFO_ /var/sadm/pkg/SUNW*/pkginfo | sed -e 's/From:.*//' |grep 2016 |head PATCH_INFO_120544-36=Installed: Thursday, December 15, 2016 8:32:13 AM EST PATCH_INFO_120544-36=Installed: Thursday, December 15, 2016 8:32:19 AM EST PATCH_INFO_120544-36=Installed: Thursday, December 15, 2016 8:32:20 AM EST PATCH_INFO_122912-37=Installed: Thursday, December 15, 2016 8:34:10 AM EST PATCH_INFO_122912-37=Installed: Thursday, December 15, 2016 8:34:11 AM EST PATCH_INFO_122912-37=Installed: Thursday, December 15, 2016 8:34:13 AM EST PATCH_INFO_150401-41=Installed: Thursday, December 15, 2016 8:52:25 AM EST PATCH_INFO_150122-01=Installed: Thursday, December 15, 2016 8:57:26 AM EST PATCH_INFO_150401-41=Installed: Thursday, December 15, 2016 8:52:26 AM EST PATCH_INFO_151724-01=Installed: Thursday, December 15, 2016 8:53:58 AM EST bash solaris 10>
Change the “year” in the grep command if you don’t get the results. You just need to start from latest year.
Leave a Reply