要显示关于软件包的信息,请参阅以下示例:不需要任何特权来显示关于软件包的信息。
列出系统中当前已安装的软件包:
$ pkg list | more
确定当前映像中是否已安装特定的软件包,且是否有更新可用。
$ pkg list amp pkg list: no packages matching 'amp' installed
显示关于未安装的软件包的更多信息。使用 –r 选项查询软件包系统信息库的过程如下:
$ pkg info -r amp Name: amp Summary: State: Not installed (Renamed) Renamed to: web/amp@0.5.11-0.133 consolidation/sfw/sfw-incorporation Publisher: solaris Version: 0.5.11 Branch: 0.133 Packaging Date: Wed Oct 27 18:31:05 2010 Size: 0.00 B FMRI: pkg://solaris/amp@0.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: 5.12 Branch: 5.12.0.0.0.48.0 Packaging Date: Mon May 19 05:51:22 2014 Size: 5.46 kB FMRI: pkg://solaris/group/feature/amp@5.12-5.12.0.0.0.48.0:20140519T055122Z Name: web/amp Summary: State: Not installed (Renamed) Renamed to: group/feature/amp@0.5.11-0.174.0.0.0.0.0 consolidation/ips/ips-incorporation Publisher: solaris Version: 0.5.11 Branch: 0.174.0.0.0.0.0 Packaging Date: Wed Sep 21 19:15:02 2011 Size: 5.45 kB FMRI: pkg://solaris/web/amp@0.5.11-0.174.0.0.0.0.0:20110921T191502Z
如果知道要安装的工具的名称,但不知道软件包的名称,则使用以下方法之一运行 search 子命令:
$ pkg search /usr/bin/emacs INDEX ACTION VALUE PACKAGE path file usr/bin/emacs pkg:/editor/gnu-emacs@24.3-5.12.0.0.0.42.0
$ pkg search file::emacs INDEX ACTION VALUE PACKAGE basename file usr/bin/emacs pkg:/editor/gnu-emacs@24.3-5.12.0.0.0.42.0