Become root.
Import the SMF service manifest.
# svccfg import /var/svc/manifest/application/pkg-server.xml
Prepare a location for your mirror server, by briefly running a packaging depot server in normal mode. The depot server will create the appropriate directory structures. In this example, /export/pkg is such a location.
# mkdir /export/pkg
# /usr/lib/pkg.depotd -d /export/pkg -p 8009
[wait for startup messages to conclude]
Deploy a second instance of the packaging server to run as a read-only mirror. Set pkg/port to a different value if you do not want your mirror to run on port 80.
# svccfg -s pkg/server
svc:/application/pkg/server> add mirror
svc:/application/pkg/server> select mirror
svc:/application/pkg/server> addpg pkg application
svc:/application/pkg/server> addpg start method
svc:/application/pkg/server> setprop start/exec= astring: "/usr/lib/pkg .depotd
--mirror -p %{pkg/port} -d %{pkg/inst_root} -t %{pkg/socket_timeout} -s % {pkg/threads}
--proxy-base=%{pkg/proxy_base}
--log-access=%{pkg/log_access} --log-errors=%{pkg/log_errors}"
svc:/application/pkg/server> setprop pkg/inst_root = astring: "/export/ pkg"
svc:/application/pkg/server> setprop pkg/threads = count: 50
svc:/application/pkg/server> setprop general/complete astring:""
svc:/application/pkg/server> setprop general/enabled boolean true
exit
Refresh the mirror.
# svcadm refresh pkg/server:mirror
Enable the mirror.
# svcadm enable pkg/server:mirror
For system performance, mount the filesystem that contains your repository with noatime, so that file accesses do not cause directory metadata updates. The following command uses ZFS.
# zfs set atime=no filesystem_name
Add a mirror to the configuration of the http://opensolaris.org repository on your local packaging clients.
# pkg set-authority -m http://my.hostname.sun.com opensolaris.org