# svccfg -s application/pkg/server setprop pkg/readonly = false
# svcadm refresh application/pkg/server
# svcadm enable application/pkg/server
When I try to use `pkgbuild' to send the package to it, I get this
error:
## Packaging complete.
Calling script /usr/local/src/packages/PKGMAPS/scripts/...
pkgsend: 'open' failed; unable to initiate transaction:
http protocol error: code: 400 reason: Bad Request
URL: 'http://localhost:80/open/0/...
Additional Details:
This operation requires that a default publisher has been set or that a publisher be specified in the FMRI 'pkg:/...
Likewise, when I point my web browser at http://localhost:80, it says:
This package repository is empty or no default publisher has been set.
How do I set the default publisher on this repository?
--
-Gary Mills- -Unix Group- -Computer and Network Services-
The -P switch is used to set the preferred publisher, see this
example:
pkg set-publisher -P -O http://pkg.sunfreeware.com sunfreeware.com
From a web page that is "no longer accessible":
Download the OpenSolaris Package Repository
Download the OpenSolaris 2009.06 IPS package repository from
dlc.sun.com.edgesuite.net/osol/opensolaris/2009/06. The repository is
available in one file or two files. Download only the "full" file or
download both the "p01" and "p02" files.
* osol-repo-0906-full.iso, 7.2G
* osol-repo-0906-p01.iso, 3.6G
* osol-repo-0906-p02.iso, 3.6G
These files are quite large and will take some time to download.
For instructions for using the two smaller files, see the README file.
The OpenSolaris release of the IPS package repository must be the same
as the OpenSolaris release that will be installed on the client
systems. That is, the repository image file (for example, osol-
repo-0906-full.iso) and the Automated Installer install image file
(for example, osol-0906-x86.iso) must be the same OpenSolaris version.
Make the Repository ISO Available
Make the contents of the repository ISO available to the
pkg.depotd(1M) server. Note that the lofi(7D) driver does not work
inside a zone.
# lofiadm -a /rpool/repo0906/osol-repo-0906-full.iso
/dev/lofi/1
# lofiadm
Block Device File Options
/dev/lofi/1 /rpool/repo0906/osol-repo-0906-full.iso -
# mount -F hsfs /dev/lofi/1 /mnt
If you receive an error message from the mount command, make sure you
specified a full absolute path to the ISO file.
Check your work:
# df -k /mnt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/lofi/1 7517822 7517822 0 100% /mnt
# ls -l /mnt/repo
total 289
drwxr-xr-x 2 root root 2048 2009-07-13 16:22 catalog
-rw-r--r-- 1 root root 965 2009-07-14 08:29 cfg_cache
drwxr-xr-x 258 root root 32768 2009-07-13 14:06 file
drwxr-xr-x 2 root root 6144 2009-07-13 16:28 index
drwxr-xr-x 1709 root root 249856 2009-07-13 16:22 pkg
drwxr-xr-x 2 root root 2048 2009-07-13 16:22 trans
drwxr-xr-x 2 root root 2048 2009-07-13 16:22 updatelog
You can continue with the instructions to configure and start the
repository server service, but you will need to remount the ISO image
each time the repository server system restarts. To avoid the need to
remount the ISO each time the system restarts, copy the repository
files as described in the next section. Then continue with the
instructions to restart the repository server service.
Copy the Repository Files
To increase the performance of repository accesses and to avoid the
need to remount the ISO image each time the system restarts, copy the
repository files from /mnt/repo to a ZFS file system.
# rsync -aP /mnt/repo /rpool/repo0906
Be sure to specify /mnt/repo and not /mnt/repo/ if you want to copy
the repo directory and not just the files and subdirectories in the
repo directory. See the rsync(1) man page.
Check your work:
# df -k /rpool/repo0906
Filesystem 1K-blocks Used Available Use% Mounted on
/rpool/repo0906 153948877 6875306 147073571 5% /rpool/repo0906
# ls -l /rpool/repo0906/repo
total 53
drwxr-xr-x 2 root root 4 2009-07-13 16:22 catalog
-rw-r--r-- 1 root root 965 2009-07-14 08:29 cfg_cache
drwxr-xr-x 258 root root 258 2009-07-13 14:06 file
drwxr-xr-x 2 root root 37 2009-07-13 16:28 index
drwxr-xr-x 1709 root root 1709 2009-07-13 16:22 pkg
drwxr-xr-x 2 root root 2 2009-07-13 16:22 trans
drwxr-xr-x 2 root root 5 2009-07-13 16:22 updatelog
Unmount the image and deallocate the block device.
# umount /mnt
# lofiadm
Block Device File Options
/dev/lofi/1 /rpool/repo0906/osol-repo-0906-full.iso -
# lofiadm -d /dev/lofi/1
# lofiadm
Block Device File Options
Configure the Repository Server Service
Use SMF commands to configure the repository server service.
# svccfg -s application/pkg/server setprop pkg/inst_root=/rpool/
repo0906/repo
# svccfg -s application/pkg/server setprop pkg/readonly=true
Check your work:
# svcprop -p pkg/inst_root application/pkg/server
/rpool/repo0906/repo
Tip
To set multiple service properties, open a vi session where you can
edit all the properties at once.
Use the following command to open a vi session where you can edit all
the properties at once:
# svccfg -s pkg/server editprop
Remember to remove the comment marker (#) from the beginning of any
lines you change.
By default, pkg.depotd listens for connections on port 80. You can
change the port by resetting the pkg/port property. See the
pkg.depotd(1M) man page or the "Creating Repositories" section of the
Image Packaging System Guide.
Copy the /rpool/repo0906/repo/cfg_cache file to a permanent location
that is accessible by the root user on system startup.
# cp /rpool/repo0906/repo/cfg_cache /rpool/repo0906/cfg_cache
Configure the pkg.depotd service to use the new configuration file:
# svccfg -s application/pkg/server setprop pkg/cfg_file=/rpool/
repo0906/cfg_cache
Check your work:
# svcprop -p pkg/cfg_file application/pkg/server
/rpool/repo0906/cfg_cache
Using a text editor, change this line:
origins = http://pkg.opensolaris.org/release
to this:
origins = http://localhost/
Replace the text after the equals sign (=) to the end of the line with
the network-accessible host name of the system that the depot server
will be hosted on. If you changed the port number, include the port
number in the origins path.
Start the Repository Service
Restart the pkg.depotd repository service.
# svcadm refresh application/pkg/server
# svcadm restart application/pkg/server
# svcadm enable application/pkg/server
To check whether the repository server is working, open a browser
window on the path you specified in the origins line in the cfg_cache
file. You should see a page very similar to the pkg.opensolaris.org/
release page. When you click the Packages link at the top of the page
to go to the Package Catalog, you should see the same number of
packages in your local repository as in the OpenSolaris release
repository for the same version of OpenSolaris.
Set The Publisher URI
The default preferred publisher for OpenSolaris systems is
opensolaris.org and the default URI for that publisher is
http://pkg.opensolaris.org/release. If you want your clients to get
packages from your local repository, you need to reset the URI for the
opensolaris.org publisher.
If you want your client systems to use only this local IPS repository
to retrieve packages for this OpenSolaris release, then set this
repository URI as the origin for the opensolaris.org publisher.
Execute the following command on each client, using the value of
origins in the cfg_cache file as the URI:
# pkg set-publisher -O http://localhost/ opensolaris.org
If you want your client systems to use this local IPS repository as a
mirror, allowing the clients to retrieve newer packages from the
pkg.opensolaris.org/release repository, then execute the following
command on each client, using the value of origins in the cfg_cache
file as the URI:
# pkg set-publisher -m http://localhost/ opensolaris.org
You should use this local IPS repository only as an origin or a
mirror.
Set The Repository URL in Your AI Manifest File
If you are using Automated Installer, set your local repository URL in
the AI manifest file. Set the default publisher to your local copy of
the OpenSolaris release repository. Optionally, set the additional
publisher to a local repository that contains custom packages.
<ai_pkg_repo_default_publisher>
<main url="http://localhost/" publisher="opensolaris.org"/>
<mirror url=""/>
</ai_pkg_repo_default_publisher>
<ai_pkg_repo_addl_publisher>
<main url="http://localhost:5555"
publisher="custom.opensolaris.org"/>
<mirror url=""/>
</ai_pkg_repo_addl_publisher>
>On Jan 16, 10:35=A0am, Gary Mills <mi...@cc.umanitoba.ca> wrote:
>> I'm using Solaris 11 Express, attempting to send an IPS package to
>> a local repository. =A0I first configured the repository with:
>>
>> =A0 =A0 # svccfg -s application/pkg/server setprop pkg/readonly =3D false
>> =A0 =A0 # svcadm refresh application/pkg/server
>> =A0 =A0 # svcadm enable application/pkg/server
[...]
>> Likewise, when I point my web browser athttp://localhost:80, it says:
>>
>> =A0 =A0 This package repository is empty or no default publisher has been=
> set.
>>
>> How do I set the default publisher on this repository?
>The -P switch is used to set the preferred publisher, see this
>example:
>pkg set-publisher -P -O http://pkg.sunfreeware.com sunfreeware.com
That seems to set the publisher on the client. I want to set it on
the repository server. How do I do that?
>On Jan 16, 2:25 pm, kartikvashishta108 <kartik.u...@gmail.com> wrote:
>> On Jan 16, 10:35 am, Gary Mills <mi...@cc.umanitoba.ca> wrote:
>>
>> > I'm using Solaris 11 Express, attempting to send an IPS package to
>> > a local repository. I first configured the repository with:
>>
>> > # svccfg -s application/pkg/server setprop pkg/readonly = false
>> > # svcadm refresh application/pkg/server
>> > # svcadm enable application/pkg/server
[...]
>> > Likewise, when I point my web browser athttp://localhost:80, it says:
>>
>> > This package repository is empty or no default publisher has been set.
>>
>> > How do I set the default publisher on this repository?
>> The -P switch is used to set the preferred publisher, see this
>> example:
>> pkg set-publisher -P -Ohttp://pkg.sunfreeware.comsunfreeware.com
>From a web page that is "no longer accessible":
Yes, I found today that I couldn't view that page.
>Configure the Repository Server Service
>Use SMF commands to configure the repository server service.
># svccfg -s application/pkg/server setprop pkg/inst_root=/rpool/
>repo0906/repo
># svccfg -s application/pkg/server setprop pkg/readonly=true
This looks like instructions for setting up a repository mirror.
That's not what I want.
>If you want your client systems to use only this local IPS repository
>to retrieve packages for this OpenSolaris release, then set this
>repository URI as the origin for the opensolaris.org publisher.
>Execute the following command on each client, using the value of
>origins in the cfg_cache file as the URI:
># pkg set-publisher -O http://localhost/ opensolaris.org
That's not what I want.
The only thing close to what I want to do is shown here:
http://www.cuddletech.com/blog/pivot/entry.php?id=1127
However, it starts pkg.depotd directly, rather than using SMF to do it.
The `--set-property' option is undocumented. Is there an official way
to do it?
eplayx001:root> head -5 pkg5.repository
[publisher]
prefix = solaris
[CONFIGURATION]
version = 4
I don't know if this is the official way, but it works for me.
Kind regards
Rolf Zimmerli
>In the repository there is the file 'pkg5.repository'
>You can set the prefix there:
>eplayx001:root> head -5 pkg5.repository
>[publisher]
>prefix = solaris
>[CONFIGURATION]
>version = 4
>I don't know if this is the official way, but it works for me.
That does seem to be the way. It's partially documented in the
`pkg.depotd' man page. The file in my repository has no prefix
defined. The configuration seems to correspond to the `--cfg source'
option. Right now it doesn't specify a source, so I suppose that
the config file is the default.