Which package delivers the file/directory I can not find?
By Tim Cook on Dec 08, 2010
Back in the day (ahem, Solaris 10 and earlier...) you could use a command like the following to figure out which package was responsible for; e.g.; "/usr/include/math.h", or any other "include/math.h", just in case it is somewhere less obvious:
mashie$ fgrep include/math.h /var/sadm/install/contents /usr/include/math.h f none 0644 root bin 10514 7356 1249334889 SUNWlibm
In other words, /var/sadm/install/contents was a flat-file index of every file, directory, link, etc. installed on the system. The last field is the package name - "SUNWlibm" in this case.
Things are a little more tricky with the new packaging system in Solaris 11 Express. Here is the equivalent "pkg contents" command:
mashie$ pkg contents -o pkg.name,path -a path='\*/include/math.h' PKG.NAME PATH system/library/math/header-math usr/include/math.h