The pkg-repository - Solaris equivalent of rpm

The pkg-repository - Solaris equivalent of rpm

Post by Tuan Nguy » Wed, 15 Oct 2003 15:57:01



Sometime I need to find out which conf files (or help file etc)
belongs to a package or from which package a head file comes from etc.
If you know Redhat's "RPM -qa/-qf/-ql" then you know what I mean.

Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
can help me out. Luckily, Sun uses a "text file" for pkgadd's
repository. So let do some sed-grep.

Solaris equivalent of rpm - The following commands are the "add-on"
for pkgadd, pkginfo, pkgchk, pkg*

1) Which packages do I have installed?
ls /var/sadm/pkg |sed 's/[A-Z]\{3,4\}//'| sort -f

2) When did I install them?
ls -ltr /var/sadm/pkg

3) Find all files in "the Apache" package: (one line)
cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
|awk '{n=NF;print $1"\t" $n}' |grep -i apache

4) where does the head file "disasm.h" come from?  (one line) (a la
"pkgchk -l -p", my is better because it doesn't need the path:-) )

cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
|awk '{n=NF;print $1"\t" $n}' |grep -i disasm.h

5) All the packages in /usr:

echo -e `grep "/usr d" /var/sadm/install/contents|sed 's/
/\\\n/g'`|tail +7|sort|more

6) All the packages in /usr/lib:

echo -e `grep "/usr/lib d" /var/sadm/install/contents|sed 's/
/\\\n/g'`|tail +7|sort|more

Enjoy
Tuan

 
 
 

The pkg-repository - Solaris equivalent of rpm

Post by Rob Janse » Wed, 15 Oct 2003 16:35:43



Quote:>Sometime I need to find out which conf files (or help file etc)
>belongs to a package or from which package a head file comes from etc.
>If you know Redhat's "RPM -qa/-qf/-ql" then you know what I mean.

>Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
>can help me out. Luckily, Sun uses a "text file" for pkgadd's
>repository. So let do some sed-grep.

>Solaris equivalent of rpm - The following commands are the "add-on"
>for pkgadd, pkginfo, pkgchk, pkg*

>1) Which packages do I have installed?
>ls /var/sadm/pkg |sed 's/[A-Z]\{3,4\}//'| sort -f

>2) When did I install them?
>ls -ltr /var/sadm/pkg

>3) Find all files in "the Apache" package: (one line)
>cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
>|awk '{n=NF;print $1"\t" $n}' |grep -i apache

>4) where does the head file "disasm.h" come from?  (one line) (a la
>"pkgchk -l -p", my is better because it doesn't need the path:-) )

>cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
>|awk '{n=NF;print $1"\t" $n}' |grep -i disasm.h

>5) All the packages in /usr:

>echo -e `grep "/usr d" /var/sadm/install/contents|sed 's/
>/\\\n/g'`|tail +7|sort|more

>6) All the packages in /usr/lib:

>echo -e `grep "/usr/lib d" /var/sadm/install/contents|sed 's/
>/\\\n/g'`|tail +7|sort|more

>Enjoy
>Tuan


 
 
 

The pkg-repository - Solaris equivalent of rpm

Post by Thomas Glanzman » Wed, 15 Oct 2003 17:39:02


Hi,

Quote:> Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
> can help me out. Luckily, Sun uses a "text file" for pkgadd's
> repository. So let do some sed-grep.

that's not true. But grepping the textfiles is much faster than using
the applications:

Solaris packet management

 pkgchk -v SUNWsshcu              # show files that belong to package
 pkgchk -l -p /usr/bin/passwd     # to which package belongs the following?
 pkgchk -p /usr/bin/passwd        # check permissions
 pkgrm -n SUNWsshcu               # deinstall package
 pkgadd -n -d ~sithglan/work/openssh/openssh-3.4p1 CIPopenssh # install package

Thnx for the collections.

Greetings,
        Thomas

 
 
 

The pkg-repository - Solaris equivalent of rpm

Post by Alan Coopersmit » Wed, 15 Oct 2003 23:00:49



|Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
|can help me out. Luckily, Sun uses a "text file" for pkgadd's
|repository. So let do some sed-grep.

It currently uses a text file, but that may not always be the case,
so it's best to know the real commands where possible.

|1) Which packages do I have installed?
|ls /var/sadm/pkg |sed 's/[A-Z]\{3,4\}//'| sort -f

Or just run pkginfo with no arguments.

|2) When did I install them?
|ls -ltr /var/sadm/pkg

pkginfo -l | grep INST

--
________________________________________________________________________


  Working for, but definitely not speaking for, Sun Microsystems, Inc.

 
 
 

The pkg-repository - Solaris equivalent of rpm

Post by Tuan Nguy » Thu, 16 Oct 2003 17:01:24



> Hi,

> > Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
> > can help me out. Luckily, Sun uses a "text file" for pkgadd's
> > repository. So let do some sed-grep.

> that's not true. But grepping the textfiles is much faster than using
> the applications:

> Solaris packet management

>  pkgchk -v SUNWsshcu              # show files that belong to package
>  pkgchk -l -p /usr/bin/passwd     # to which package belongs the following?
>  pkgchk -p /usr/bin/passwd        # check permissions
>  pkgrm -n SUNWsshcu               # deinstall package
>  pkgadd -n -d ~sithglan/work/openssh/openssh-3.4p1 CIPopenssh # install package

> Thnx for the collections.

> Greetings,
>    Thomas

Hi,

Thanks for all the respons.

Quote:> > Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
> > can help me out. Luckily, Sun uses a "text file" for pkgadd's
> > repository. So let do some sed-grep.

> that's not true. But grepping the textfiles is much faster than using
> the applications:

My mind was "just a pkg* command which can handle my request" or "an
option in
pkginfo which can do the jobs". Just some more options in the pkg*
command.

Yes I know "pkginfo -p -l" (look at step 4 at my first post), you
don't need a path to use my.

Yes I forgot pkginfo (without command, step 1 from my first post). My
is just cut off the 3,4 letters (SUNW, SFW) in front.

Yes I had overlooked the "pkginfo -v SUNWsshcu" (step 3 in my post).
Thanks for the tips.

BR, Tuan