Command to list or view the files in .pkg (solaris) and how to extract without installing

In Linux for .rpm

we can list or view the files using the command

rpm -qpl <file.rpm>

and to extract, the command is

rpm2cpio <file.rpm> | cpio -idvh

I would like to know the commands which has same functionality as above for solaris ( .pkg)

Thanks in Advance

List pkgs

$ pkginfo

There is no specific way to extract files from pkgs you can search for some tool like rpm2cpio that is compatible with Solaris packaging system.

or you can use the native command pkgtrans

$ pkgtrans pkg /SOMEDIR

Hi

The command pkginfo is to list the files for the installed package. I am looking for the command to list the files in NON Installed package.

For example:- I would like to see the files in the package abc-sol10x_9.11.pkg without installing it. I could do it for rpm using rpm -qpl file_name but I am not sure for .pkg

Thanks

pkginfo -p list installed packages
but not as rpm -qpl

$pkginfo 

If you have rpm distro or some else Linux than you can convert Solaris package to rpm package.

Now input looks

sudo alien -r input.pkg

But problem is you need SVR4 tools to manipulate this data, you can use this tools to get SVR4 tools The Heirloom Packaging Tools: pkgadd, pkgmk, etc.

Once you get rpm you can extract all data from converted packge using rpm2cpio command

rpm2cpio convertedPKG.rpm | cpio -idmv

That's overkill. Just extract the pkginfo and pkgmap information from the package datastream to a temporary directory and you'll get the package files and more information there. For example (using a compressed package):

pkgtrans -i <(gunzip < somepackage.pkg.gz) /tmp/foo/ all
less $(find /tmp/foo -type f)