Go to main content

man pages section 1: User Commands

Exit Print View

Updated: July 2017



pkgsend - Image Packaging System publication client


/usr/bin/pkgsend [options] command [cmd_options] [operands]
/usr/bin/pkgsend generate [-T pattern] [--target file]
    source ...
/usr/bin/pkgsend publish [-b bundle]... [-d source]...
    [-s repo_uri_or_path] [--key ssl_key --cert ssl_cert]...
    [-T pattern] [--no-catalog] [manifest ...]


pkgsend enables the publication of new packages and new package versions to an image packaging repository using package manifests. To create or manage repositories, see pkgrepo(1). To create package archives from packages in an existing repository, see pkgrecv(1). For more information about package manifests, see pkg(5).

After a pkgsend publish operation, if your repo_uri_or_path repository must support pkg search operations, run pkgrepo refresh on the repository to update search indexes.


The following options are supported:


Display a usage message.

Sub Commands

The following subcommands are supported:

pkgsend generate [–T pattern] [–-target file] source ...

Read each source (such as an SVR4 package, a directory, or a tar file) and emit the manifest that describes the source to stdout.

The output manifest can then be annotated, have dependencies added or analyzed using pkgdepend, and have its correctness verified using pkglint before being passed to the publish subcommand.

    The following are supported sources:

  • Filesystem format SVR4 packages

  • Datastream format SVR4 packages

  • tar files

  • Directories

If the base name of files in the source match the patterns specified with –T, the timestamp of the file is added to the action for that file. The pattern uses shell matching rules:


Matches everything.


Matches any single character.


Matches any character in seq.


Matches any character not in seq.

When the specified source is a directory, there is no clear way to distinguish a file action from a hardlink action when there are multiple path names for a single inode. Normally, the first one found in the file system walk is treated as a file and the rest as hardlinks. This can be arbitrary, depending on the implementation of the file system. To specify which path names should be treated as files, pass each path name as an argument to the –-target option. This option has no effect on other types of sources because they are capable of expressing which path names are files and which are hardlinks.

When SVR4 packages are provided as a source, pkgsend checks that no files with class action scripts are present and no preinstall, postinstall, preremove, or postremove scripts are present. An exception is made for any SMF manifests installed with the manifest class. BASEDIR is removed from all relocatable paths.

The SVR4 DESC parameter is converted to a pkg.description value. The SVR4 NAME parameter is converted to a pkg.summary value.

When generating a manifest based on a directory, the owner and group for each file and directory defaults to root and bin respectively.

pkgsend publish [–b bundle]... [–d source]... [–s repo_uri_or_path] [–-key ssl_key –-cert ssl_cert]... [–T pattern] [–-no-catalog] [manifest ...]

Publish a package using the specified package manifests to the target package repository, retrieving files for the package from the provided sources. If multiple manifests are specified, they are joined in the order provided. If a manifest is not specified, the manifest is read from stdin.

If not specified, pkgsend publish adds the build version to the package FMRI. The publish tool also adds the timestamp (the current time in UTC) to the package FMRI. See the pkg(5) man page for information about the version string of a package FMRI.

If multiple pkgsend publish processes might be publishing to the same –s repository simultaneously, specifying the –-no-catalog option is recommended. See the description of the –-no-catalog option below.

–b bundle

Add the specified bundle to the list of sources to search when looking for files in the manifest. Bundles are sources such as tar files and SVR4 packages. If this option is specified multiple times, sources are searched in the order they appear on the command line. If both –b and – d are specified, –d sources are searched first. For a description of supported bundles and how they are used, refer to the generate subcommand above.

–d source

Add the specified directory to the list of sources to search when looking for files in the manifest. If this option is specified multiple times, sources are searched in the order they appear on the command line. For a description of supported sources and how they are used, refer to the generate subcommand above.

–s repo_uri_or_path

Publish the package to the repository located at the given URI or file system path. See the “Notes” section below for more information about restrictions and suggestions for publication. See also the “Environment Variables” section.

–-key ssl_key –-cert ssl_cert

Use the –-key option to specify a client SSL key file to use for package retrieval from an HTTPS repository. Use the –-cert option to specify a client SSL certificate file to use for package retrieval from an HTTPS repository. This option pair can be specified multiple times.


Do not add the package to the publisher's catalog. This option is recommended whenever multiple packages are being published at one time because updates to publisher catalogs must be performed serially. Publication performance might be significantly reduced if this option is not used when multiple processes are simultaneously publishing packages. After publication is complete, the new packages can be added to the respective publisher catalogs by using the pkgrepo refresh command.

For a description of the –T option, see the generate subcommand above.

Environment Variables


The path or URI of the destination repository.


Example 1 Generate and Publish a Package

Create a package using pkgsend generate and publish it.

$ pkgsend generate /path/to/proto > /path/to/manifests/foo.p5m

Add the package FMRI for the example.com publisher to the beginning of foo.p5m.

set name=pkg.fmri value=pkg://example.com/foo@1.0

The resulting manifest should look like this:

set name=pkg.fmri value=pkg://example.com/foo@1.0
dir group=sys mode=0755 owner=root path=usr
dir group=bin mode=0755 owner=root path=usr/bin
file usr/bin/foo group=bin mode=0555 owner=root path=usr/bin/foo
$ pkgsend publish -s http://example.com:10000 -d /path/to/proto \
Example 2 Create and Publish a Trivial Package

Create a manifest for publisher example.com containing the following lines:

set name=pkg.fmri value=pkg://example.com/foo@1.0-1
file /exdir/foo mode=0555 owner=root group=bin path=/usr/bin/foo

Publish the package:

$ pkgsend publish -s http://example.com:10000 -d /exdir
Example 3 Use a Preexisting Manifest

Publish a package using file system based publication and a preexisting manifest.

$ pkgsend publish -s /tmp/example_repo -d /tmp/pkg_files \

Exit Status

The following exit values are returned:


Command succeeded.


An error occurred.


Invalid command line options were specified.


An unanticipated exception occurred.


See attributes(5) for descriptions of the following attributes:

Interface Stability

See Also

pkgdepend(1), pkgrepo(1), pkg.depotd(1M), pkg(5)

Packaging and Delivering Software With the Image Packaging System in Oracle Solaris 11.3



Because of publication protocol limitations, file system based publication must be used when publishing individual package files that are greater than 128 MB in size. File system based publication is also recommended when access control for a repository is needed.

When using file system based publication, any pkg.depotd processes that are serving the target repository must be restarted after publication is completed for the changes to be reflected in its web interface or search responses. See pkg.depotd(1M) for more information.