Which package delivers the file/directory I can not find?

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

Comments:

hi Tim,

How about with less typing :

# pkg search '\*/include/math.h'
INDEX ACTION VALUE PACKAGE
path file usr/include/math.h pkg:/system/library/math/header-math@0.5.11-0.151.0.1

(The above finds the package that has the include/math.h file. The package \*may\* be installed, or it might not be)

# pkg info header-math
pkg: info: no packages matching the following patterns you specified are
installed on the system. Try specifying -r to query remotely:

header-math

(Package isn't installed locally)

# pkg info -r header-math
Name: system/library/math/header-math
Summary: Math & Microtasking Library Headers & Lint Files
Description: Math & Microtasking Library Headers & Lint Files
Category: System/Libraries
State: Not installed
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Branch: 0.151.0.1
Packaging Date: Fri Nov 05 06:11:39 2010
Size: 171.31 kB
FMRI: pkg://solaris/system/library/math/header-math@0.5.11,5.11-0.151.0.1:20101105T061139Z

(Package information pulled from the repository)

Cheers!
-- Gary

Posted by Gary Riseborough on December 08, 2010 at 01:48 PM PST #

Doesn't "pkg search" do what you want to do?

Posted by Sean on December 08, 2010 at 10:24 PM PST #

For old days isn't better just use: pkgchk -l -P math.h ?

Posted by xtrondo on December 15, 2010 at 02:37 AM PST #

Post a Comment:
Comments are closed for this entry.
About

Tim Cook's Weblog The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today