How to create a Solaris repo in solaris server by using solaris.iso file

solaris repo
solaris repo

Solaris is a Unix based operating system which is developed by Sun Microsystems. Best known for his scalability on SPARC Systems. Solaris is proprietary Software.

Solaris which only look simple but very complex when start working and at the same time very interesting
Whenever we start working on solaris we often found that some of packages are not installing correctly even though we have created the repo

It will throw an error like –
root@solaris:/ # pkg install /group/feature/multi-user-desktop
Creating Plan (Solver setup): | pkg install: No matching version of group/feature/multi-user-desktop can be installed:
Reject: pkg://solaris/group/feature/multi-user-desktop@0.5.11-
Reason: This version is excluded by installed incorporation consolidation/userland/userland-incorporation@0.5.11-
You have new mail in /var/mail/root

Here is the step by step guide of how to create a Solaris repo from Solaris.iso file

download the Solaris repo files from here –

Step-1 Check repo file path in the solaris server
# pkg publisher

solaris  origin online F

this is by default package repo link ( )shown when rebuild solaris

for removing default pkg publisher path

# pkg unset-publisher solaris
# pkg publisher 

Step-2 make a directory which contains the solaris.iso image file
# mkdir /Sol-11_3
# ls -l
-rwxr-xr-x   1 root     root     9940729856 Jul 26 10:11    Solaris.iso

Step-3 make Block device file of current directory /Sol-11_3/Solaris.iso
# lofiadm -a /sol-11_3/Solaris.iso

Step-4 Mount the Block device file temporary into /mnt folder
# mount -F hsfs /dev/lofi/1 /mnt

Step-5 As root, create a ZFS file system for the package repository in the root pool and set compression to on:

# zfs create -o atime=off -o compression=on rpool/export/repoSolaris11
# zfs list
rpool   14.7G   168G    94K       
/rpoolrpool/export/repo2010_11    31K   168G    31K  /export/repoSolaris11

Step-6 copy all the repository file onto the ZFS file system we have created for permanently making of repo file list
# rsync -aP /mnt/repo /export/repoSolaris11

It  will copying all the file into /export/repoSolaris11 wait until it get completed

Step-7 refresh the created Files system
# pkgrepo -s /export/repoSolaris11/repo refresh

Step-8 Now the local repository has been created on your server you need to configure it that the client will take the packages from the local repository you have created
# pfexec pkg set-publisher -G ‘*’ -g file:///export/repoSolaris11/repo solaris

# pkg publisher
solaris  origin online F file:///export/repoSolaris11/repo/

now your local repository has been created and you have start installing any package from this local repository file .

Enjoy !!!