October 3, 2012

Solaris 11: how to setup IPS repository

Posted in Solaris at 2:13 pm by alessiodini

In these days i’m studying for take oracle 11 OCP.
For this purpose i’m testing/playing/working with every new feature from Solaris 11.
One of these is IPS.

From Solaris 11 packages are managed through pkg command, pkgadd,pkgrm,etc.etc. are legacy.

First of all i need to have one IPS repository as source of packaging system.
So , let’s create it 🙂

1) i installed Solaris 11 with text based method ( no gui then )
2) i downloaded the repository files from oracle.com ( files are for both sparc / x86_64 platforms )

3) i make the image ( the command comes from oracle.com ) :
cat sol-11-1111-repo-full.iso-a sol-11-1111-repo-full.iso-b > sol-11-1111-repo-full.iso

4) i make the filesystem where i will put repository files ( i already maked the zpool alepool for this purpose )
zfs create -o compression=on alepool/export/IPS

5) root@ips:/sun-temp# lofiadm -a sol-11-1111-repo-full.iso
/dev/lofi/1
root@ips:/sun-temp#

6) root@ips:/sun-temp# mount -F hsfs /dev/lofi/1 /mnt

7) i copied the files between the image and the fs:
root@ips:~# cd /mnt
root@ips:/mnt# find . -print | cpio -dumpv /alepool/export/IPS

8) i updated the manifest for the right repository filesystem:
root@ips:/mnt# svccfg -s application/pkg/server setprop pkg/inst_root=/alepool/export/IPS/repo
root@ips:/mnt#

I verified it:
root@ips:/mnt# svcprop -p pkg/inst_root application/pkg/server
/alepool/export/IPS/repo

9) i updated the readonly flag about the repository:
metto il flag readonly per le modifiche
root@ips:/mnt# svccfg -s application/pkg/server setprop pkg/readonly=true

I verified it:
root@ips:/mnt# svcprop -p pkg/readonly application/pkg/server
true

10) manifest refresh:
root@ips:/mnt# svcadm refresh application/pkg/server

11) manifest enable:
svcadm enable application/pkg/server

12) manifest check:
root@ips:/mnt# svcs -xv
root@ips:/mnt#
root@ips:/mnt# svcs pkg/server
STATE STIME FMRI
online 18:12:36 svc:/application/pkg/server:default
root@ips:/mnt#

13) catalog refresh:
root@ips:/mnt# pkgrepo refresh -s /alepool/export/IPS/repo
Initiating repository refresh.
root@ips:/mnt#

14) publisher check:
root@ips:/mnt# pkg publisher
PUBLISHER TYPE STATUS URI
solaris origin online http://pkg.oracle.com/solaris/release/
root@ips:/mnt#

15) ok. At this moment i had oracle.com as uri , i updated it! 😉
root@ips:/mnt# pkg set-publisher -G \
> http://pkg.oracle.com/solaris/release/ \
> -g http://ips solaris

i changed it from oracle.com to ips ( this system )

16) new publisher check:
root@ips:/mnt# pkg publisher
PUBLISHER TYPE STATUS URI
solaris origin online http://ips/
root@ips:/mnt#

17) as we did during the course , I tested the pkg apptrace:
root@ips:/mnt# pkg list apptrace
pkg list: no packages matching ‘apptrace’ installed <– pkg looked if apptrace was installed

18) i looked for that pkg:
pkg search apptrace
INDEX ACTION VALUE PACKAGE
pkg.description set Apptrace utility for application tracing, including shared objects pkg:/developer/apptrace@0.5.11-0.175.0.0.0.2.1
pkg.summary set Apptrace Utility pkg:/developer/apptrace@0.5.11-0.175.0.0.0.2.1
basename file usr/bin/apptrace pkg:/developer/apptrace@0.5.11-0.175.0.0.0.2.1
pkg.fmri set solaris/developer/apptrace pkg:/developer/apptrace@0.5.11-0.175.0.0.0.2.1

nice! with this i got a response from ips server , so i saw that it was working!

19) apptrace installation:
root@ips:/mnt# pkg install apptrace
Packages to install: 1
Create boot environment: No
Create backup boot environment: No

DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 10/10 0.1/0.1

PHASE ACTIONS
Install Phase 29/29

PHASE ITEMS
Package State Update Phase 1/1
Image State Update Phase 2/2

Nice!!!! 😀
I saw that the repository is web available, this is a screenshot i did

Advertisements

4 Comments »

  1. Collette said,

    This really answered my problem, thank you!

  2. offshore said,

    Finally, it’s worth talking a bit about the devguide. We wrote the IPS Developer Guide in time for the initial release of Solaris 11, but didn’t quite make the deadline for the official docs.oracle.com documentation release, leading us to publish it ourselves on OTN and opensolaris.org. Since then, we’ve had a complaints about the perceived lack of developer documentation for IPS, which was unfortunate.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: