Solaris: List Installed Packages with pkginfo

The pkginfo command in Solaris is capable of providing detailed information about the packages installed on a system. This tech-recipe describes some of its uses in listing numerous packages.


To list all packages installed on a Solaris system, use the following:

pkginfo
system SUNWsndmu Sendmail user
system SUNWsolnm Solaris Naming Enabler
system SUNWsprot Solaris Bundled tools
...

The output lists the category, the package name (like SUNWsprot), and a human readable name (Solaris Bundled Tools). The default categories are system and application, although additional categories can be used when making packages to simplify package management. To limit the categories displayed when listing packages, use the -c switch:

pkginfo -c application

The output of pkginfo will generally display pages of output, so it is convenient to pipe its output to more. When looking for a specific package, use pkgadd with the grep command to search for the name of the package or a part of its human readable name. Note the example below:

pkginfo | grep SUNWsndmu
pkginfo | grep -i sendmail

The latter example uses the -i switch to make grep case insensitive, matching upper or lower case.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

7 Responses to “Solaris: List Installed Packages with pkginfo”

  1. October 06, 2009 at 3:43 pm, Rob Long said:

    THANK YOU!!!

    Reply

  2. January 11, 2011 at 10:03 pm, Joe said:

    Thank you!

    Reply

  3. April 26, 2011 at 7:15 pm, Trainingv said:

    thanks.

    Reply

  4. April 26, 2011 at 7:34 pm, Trainingv said:

    thanks!

    Reply

  5. February 27, 2012 at 3:53 pm, basma said:

    thanks a lot for the great effort but would you please tell me what command should i use to list the UN-installed packages in cdrom ?? thanks in advance

    Reply

  6. October 31, 2012 at 12:04 pm, Shakeel said:

    Hi
    I need to Output pkginfo as follows:

    Name: Application Name
    Summary: Application Summary
    Install Date: Date on which the Package Installed

    ###### SEPERATOR ###########

    Name: Application Name
    Summary: Application Summary
    Install Date: Date on which the Package Installed

    ###### SEPERATOR ###########

    ……

    Note the SEPERATOR I need SEPERATOR after each Package Information and one more thing that I may put my on Label in front of Attribute Value e.g.

    Name: Application Name

    App Name: Application Name

    Thanks

    Shakeel

    Reply

  7. October 31, 2012 at 12:38 pm, Shakeel said:

    Can you please help me to get the following Output using the pkginfo or any other command.

    Name: Application Name
    Summary: Application Summary
    Install Date: Date of Installation
    Package State: Package Status (Committed)

    ### SEPERATOR ######
    Name: Application Name
    Summary: Application Summary
    Install Date: Date of Installation
    Package State: Package Status (Committed)

    ### SEPERATOR ######
    ……

    Please note that I need SEPERATOR after every package information and other thing is I need different Label in front of Attribute Value.

    Package State: Package Status (Committed) instead of State: Package Status (Committed)

    Notice I have used Package State instead of State.

    Regards,

    Shakeel

    Reply

Leave a Reply