Linux / Unix Tips and Tricks

This blog contains Linux / Unix Tips and Tricks, collected during my work as a Unix System Administrator.
They are here for my own reference, but they might help you as well !

Solaris: Determinate to which package a file belongs

len | 12 December, 2008 11:45

I had an issue with software which was complaining about the version of /usr/lib/libCstd.so.1
So I wanted to know to which package this particular file belongs, in order to see if there are any updates available for this package. Here's how to do it:

/usr/sbin/pkgchk -l -p <absolute filename or directory>

So in my case I ran:

$ /usr/sbin/pkgchk -l -p /usr/lib/libCstd.so.1
Pathname: /usr/lib/libCstd.so.1
Type: regular file
Expected mode: 0755
Expected owner: root
Expected group: bin
Expected file size (bytes): 1915796
Expected sum(1) of contents: 63488
Expected last modification: Oct 24 22:23:55 2008
Referenced by the following packages:
        SUNWlibC
Current status: installed
 

As shown above the file /usr/lib/libCstd.so.1 belongs to package SUNWlibC.

The command pkgchk uses a flat file that contains the file and package information. You could as well directly use that:

$grep libCstd.so.1 /var/sadm/install/contents
/usr/lib/libCstd.so.1 f none 0755 root bin 1915796 63488 1224879835 SUNWlibC
/usr/lib/sparcv9/libCstd.so.1 f none 0755 root bin 2350704 39866 1224879861 SUNWlibCx

 

 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb