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


 
Thread Tools Search this Thread
Operating Systems Solaris Command to list or view the files in .pkg (solaris) and how to extract without installing
# 1  
Old 09-17-2011
Question 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
# 2  
Old 09-17-2011
List pkgs
Code:
$ 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

Code:
$ pkgtrans pkg /SOMEDIR

# 3  
Old 09-19-2011
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

Last edited by frintocf; 09-19-2011 at 03:17 AM.. Reason: Correction
# 4  
Old 09-19-2011
pkginfo -p list installed packages
but not as rpm -qpl

Code:
$pkginfo

Quote:
-p

Display information for partially installed packages
only.
# 5  
Old 09-19-2011
If you have rpm distro or some else Linux than you can convert Solaris package to rpm package.

Quote:
alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages
Now input looks

Code:
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

Code:
rpm2cpio convertedPKG.rpm | cpio -idmv

# 6  
Old 09-19-2011
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):
Code:
pkgtrans -i <(gunzip < somepackage.pkg.gz) /tmp/foo/ all
less $(find /tmp/foo -type f)

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris View/Transfer Files Android Phone

I'm trying to sync/transfer files from my UNIX box and Android Phone and vice versa. I know that Android Phones show up seamlessly (mostly) in Linux given their incestuous relationship. Is there a way to do it in UNIX or more specifically in Solaris 11.3 (i86)?:confused: I haven't found one... (2 Replies)
Discussion started by: Nostradamus1973
2 Replies

2. Solaris

# pkg publisher gives bash: pkg: command not found

This is the operating system im using Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC I need to install some packages by setting local repository While i run the below command # pkg publisher command returns bash: pkg: command not found while looking for /usr/bin/pkg i get bash:... (2 Replies)
Discussion started by: babinlonston
2 Replies

3. Shell Programming and Scripting

Extract a list of files using unzip command

Hi all, this is my first and i can't speak english well, so please be kind ! Here is my problem : I want to unzip a list of .zip files stored in one directory, so I though about using that : unzip '*.zip' Thing is that all of my zipped folders contain a file with the unique same name :... (6 Replies)
Discussion started by: remissssss
6 Replies

4. Solaris

Pkg problem, one zone trying pkg.Oracle.com on port 1008

Hi Solaris Experts, The pkg utility on one of my non-global zones has stopped working, it's trying to connect to port 1008 at pkg.oracle.com I was using pkg successfully from this zone, but now it's showing this error: lzone1 $ pkg search xterm pkg: Some repositories failed to respond... (4 Replies)
Discussion started by: ad101
4 Replies

5. Solaris

How extract SUNWexplo.7.1.pkg & SUNWexplu.7.1.pkg from install_stb.sh?

Hi all, Could please guideas how to extract SUNWexplo.7.2.pkg & SUNWexplu.7.2.pkg from install_stb.sh. I need to upgrade my Sun Explorer to 7.2 version from 7.1 . This what written in read me file about its installation: The Lightweight Availability Collection Tool (LWACT) is no... (1 Reply)
Discussion started by: manalisharmabe
1 Replies

6. UNIX for Dummies Questions & Answers

view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first)

Hi Howto view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first) $ ls -lrt total 4477 -rwxrwxr-x 1 oracle dba 569745 Apr 4 19:45 4_person2profileCon.txt.gz.04.04.11* -rwxrwxr-x 1 oracle dba 3783 Apr 4 19:45... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

7. AIX

Installing HP open view in AIX

Hi, I am new to AIX, I have to install HP Open View on AIX OS and I would appreciate if anyone can guide me how to install it step be step, any pointer in the direction would also help. I thank all in advance ! (1 Reply)
Discussion started by: Rookie_newbie
1 Replies

8. Shell Programming and Scripting

Command to view files in Directory

Hi, Can u provide me the command to view files in a directory.Urgent Pls. -Vamsi (4 Replies)
Discussion started by: VamsiVasili
4 Replies

9. Shell Programming and Scripting

Command to view files in Directory

Hi, Can you help me in providing me a command to view all files present in a directory. Thanks a lot. -Vamsi (1 Reply)
Discussion started by: VamsiVasili
1 Replies

10. Solaris

check list for installing solaris 9

Hi, Does anyone have check list of installing solaris 9? I will be installing solaris 9 on Sun Fire V880 . Please help me. Thanks (8 Replies)
Discussion started by: sriny
8 Replies
Login or Register to Ask a Question

Featured Tech Videos