Solaris pkg equivalent to rpm -q --whatprovides

The Rosetta stone for unix isn't quite up to date with Solaris 10+/OpenSolaris and its linux entries could be expanded to include other linux distributions and versions. But it is a good overview of some differences a sysadmin would encounter when migrating between various flavors of unix.

Since linux and Solaris have several package formats to keep track of, I occasionally forget the syntax of installing and querying various package databases. For example, the Solaris SVR4 package equivalent to:

-bash-2.05b# rpm -q --whatprovides /bin/ls
coreutils-4.5.3-26
is this:
 bash-3.00$ grep "/usr/bin/ls" /var/sadm/install/contents
/usr/bin/ls f none 0555 root bin 23480 47244 1131589504 SUNWcsu
I occasionally forget this so I figured that I should write it down here in case anyone else is looking for it.

Update:

Thanks Jason for the comment. I agree that in most circumstances it would be better to use the pkgchk command:

pkgchk -l -p /usr/bin/ls

Comments:

Why not pkgchk -l -p /usr/bin/ls ??

Posted by Jason on February 22, 2006 at 08:12 AM GMT+00:00 #

Jason, Thanks! I'll update the entry to add your suggestion. I agree, using the standard package tools is better than greping the underworld.

Posted by bnitz on February 22, 2006 at 08:23 AM GMT+00:00 #

In response to Jason's comment: why not use pkgchk? Because grep - particularly a reasonably performant grep like ggrep - is 10 times faster than pkgchk, that's why not.

Posted by Peter Tribble on February 22, 2006 at 09:31 AM GMT+00:00 #

Peter, Thank you for the tip! It sounds like there is plenty of room for improvement with grep and the SVR4 package tools.

Posted by bnitz on February 23, 2006 at 03:15 AM GMT+00:00 #

The SVR4 package tools don't yet seem to be on the wicked fast code browser, so I suspect they're awaiting legal approval. I'd also like to see why /usr/bin/which isn't a script and why it starts with #!/usr/bin/csh -f to disable sourcing of .cshrc but almost immediatly sources .cshrc in the script!

Posted by bnitz on February 28, 2006 at 03:22 AM GMT+00:00 #

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

bnitz

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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