Which pkg subcommand should you use to identify the package, based on the absolute path to the binary?

While examining an Oracle Solaris 11 system, you discover an unfamiliar ELF binary in the
/usr/bin directory. You want to know which package installed the binary. Which pkg subcommand
should you use to identify the package, based on the absolute path to the binary?

While examining an Oracle Solaris 11 system, you discover an unfamiliar ELF binary in the
/usr/bin directory. You want to know which package installed the binary. Which pkg subcommand
should you use to identify the package, based on the absolute path to the binary?

A.
pkg info

B.
pkg list

C.
pkg search

D.
pkg contents

Explanation:
* pkg info
The pkg info command displays information about a package, including the name, installed state,
version, packaging date, package size, and the full FMRI. With no options or operands, this
command displays information about all packages that are installed in the current image. To
narrow your results, provide one or more package names. You can use wildcards in the package
names.
* Use the pkg info command to display more information. Because you already know the package
is not installed in this image, use the -r option to query the package repository.
$ pkg info -r amp
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
Branch: 0.174.0.0.0.0.2559
Packaging Date: Wed Sep 21 19:12:55 2011
Size: 5.45 kB
FMRI: pkg://solaris/group/feature/[email protected],5.11-0.174.0.0.0.0.2559:20110921T191255Z

Name: web/amp
Summary:
State: Not installed (Renamed)
Renamed to: group/feature/[email protected]
consolidation/ips/ips-incorporation
Publisher: solaris
Version: 0.5.11
Build Release: 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/[email protected],5.11-0.174.0.0.0.0.0:20110921T191502Z
Incorrect:
Not B: pkg list
The pkg list command tells you whether a package is installed in the current image and whether
an update is available. With no options or operands, this command lists all packages that are
installed in the current image. To narrow your results, provide one or more package names. You
can use wildcards in the package names.
Not C:
pkg search
Like the pkg contents command, the pkg search command examines the contents of packages.
While the pkg contents command returns the contents, the pkg search command returns the
names of packages that match the query.
Not D:
* pkg contents
Display the contents (action attributes) of packages. With no options or operands, display the
value of the path attribute for actions installed in the current image, sorted alphabetically by
attribute value.
* The following example shows the pkg contents default behavior. Use options to specify which
actions and attributes to display.
$ pkg contents e1000g
PATH
kernel
kernel/drv
kernel/drv/amd64
kernel/drv/amd64/e1000g

kernel/drv/e1000g.conf
usr/share/man/man7d
usr/share/man/man7d/e1000g.7d
Incorrect:
Not A: pkg info
Display information about packages in a human-readable form. Multiple FMRI patterns can be
specified. With no patterns, display information on all installed packages in the image.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Bednario

Bednario

C. PKG SEARCH

Pal

Pal

C
# pkg search /usr/bin/zip
INDEX ACTION VALUE PACKAGE
path file usr/bin/zip pkg:/compress/[email protected]