Solaris 11 pkg repository commands Cheat sheet (Part – 2)

Continuing from Previous post. Covering pkg and “pkg info” commands here.

  • SYNTAX : for pkg command

pkg list [-Hafnsuv] [-g path_or_uri …] [–no-refresh]
[pkg_fmri_pattern …]

How to list the version of installed package.

root@solaris11:~# pkg list diffstat
text/diffstat 1.51- i–

How to list the information related to the package which is not installed on server.

root@solaris11:~# pkg list -a amp
group/feature/amp 0.5.11- —

If you issue the above command for installed package it will also available updated version of package also.

To list the FMRI of package add the -v option in above command.

root@solaris11:~# pkg list -av ‘amp’
pkg://solaris/group/feature/amp@0.5.11,5.11- —

To list all the packages including those packages which can’t be installed on server. Here r option indicates that package has been renamed.

root@solaris11:~# pkg list -af ‘*diffstat’
SUNWdiffstat 1.45- –r
text/diffstat 1.51- i–

Equivalent of yum check-update of RHEL below is the command. To list the all the packages for which update is available.

root@solaris11:~# pkg list -u
pkg: no packages have newer versions available

One more Important option here is -g which can help us to mention the URI from which we want to get the package.

  • SYNTAX : for pkg info command

pkg info [-lr] [-g path_or_uri …] [–license] [pkg_fmri_pattern …]

If the package is already installed issue below command to get the information.

root@solaris11:~# pkg info diffstat
Name: text/diffstat
Summary: A utility which provides statistics based on the output of diff
Description: The diff command compares files line by line. Diffstat reads the
output of the diff command and displays a histogram of the
insertions, deletions and modifications in each file. Diffstat
is commonly used to provide a summary of the changes in large,
complex patch files. Install diffstat if you need a program
which provides a summary of the diff command’s output.
Category: System/Text Tools
State: Installed
Publisher: solaris
Version: 1.51
Build Release: 5.11
Packaging Date: February 7, 2012 03:52:54 AM
Size: 49.59 kB
FMRI: pkg://solaris/text/diffstat@1.51,5.11-

If the package is not installed on server. We have to add -r option to fetch the information for that package. It will list all the matching packages.

root@solaris11:~# pkg info ‘amp’
pkg: info: no packages matching the following patterns you specified are
installed on the system. Try specifying -r to query remotely:

root@solaris11:~# pkg info -r ‘amp’
Name: amp
State: Not installed (Renamed)
Renamed to: web/amp@0.5.11-0.133
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Branch: 0.133
Packaging Date: October 27, 2010 06:31:05 PM
Size: 0.00 B
FMRI: pkg://solaris/amp@0.5.11,5.11-0.133:20101027T183105Z

Name: group/feature/amp
Summary: AMP (Apache, MySQL, PHP) Deployment Kit for Oracle Solaris
Description: Provides a set of components for deployment of an AMP (Apache,
MySQL, PHP) stack on Oracle Solaris
Category: Meta Packages/Group Packages (org.opensolaris.category.2008)
Web Services/Application and Web Servers (org.opensolaris.category.2008)
State: Not installed
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Packaging Date: September 4, 2012 06:03:28 PM
Size: 5.46 kB
FMRI: pkg://solaris/group/feature/amp@0.5.11,5.11-

Name: web/amp
State: Not installed (Renamed)
Renamed to: group/feature/amp@0.5.11-
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Packaging Date: September 21, 2011 07:15:02 PM
Size: 5.45 kB
FMRI: pkg://solaris/web/amp@0.5.11,5.11-


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s