How to Create Local Repository in Solaris 11 ?

In this post I am going to explain the procedure to create the Local repository on Solaris 11.1

Step 1 : I have downloaded the two ISO files from Oracle site for x86_64. I put them in zfs file system.

Link to Download the images.

http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html?ssSourceSiteId=opn

root@solaris11:~# cd /root/repo-pool/zfs1/

root@solaris11:~/repo-pool/zfs1# ls -lrt
total 14494001
-rw-r–r– 1 root root 3670016000 Dec 22 08:21 sol-11_1-repo-full.iso-a.iso
-rw-r–r– 1 root root 3661631488 Dec 22 11:49 sol-11_1-repo-full.iso-b.iso

Step 2: After that I am combined these two files to make one iso file in zfs file system zfs1 on pool1

root@solaris11:~# cat sol-11_1-repo-full.iso-a.iso sol-11_1-repo-full.iso-b.iso > /pool1/zfs1/sol-11_1-repo-full.iso

root@solaris11:/pool1/zfs1# ls -lrt
total 14330041
-rw-r–r– 1 root root 78 Jun 14 02:40 pkg5.repository
-rw-r–r– 1 root root 7331647488 Jun 14 16:04 sol-11_1-repo-full.iso

Step 3 : Now mount this file on temporary mount point.

root@solaris11:~# mount -F hsfs /pool1/zfs1/sol-11_1-repo-full.iso /mnt

Step 4 : Prepare the zfs file system which is going to hold the packages for repository. Then use the rsync command to copy the Publisher from source to destination.

root@solaris11:~# pkgrepo create /repo-pool/zfs1

root@solaris11:~# rsync -aP mnt/repo /repo-pool/zfs1/

Step 5 : After completion of above operation we can proceed with next steps.

root@solaris11:~# pkg set-publisher -G ‘*’ -M ‘*’ -g /repo-pool/zfs1/ solaris

root@solaris11:~# svccfg -s application/pkg/server setprop pkg/inst_root=/repo-pool/zfs1/ ool/zfs1/

root@solaris11:~# svccfg -s application/pkg/server setprop pkg/readonly=true

root@solaris11:~# svcprop -p pkg/inst_root application/pkg/server
/repo-pool/zfs1/

root@solaris11:~# svcadm refresh application/pkg/server

root@solaris11:~# svcadm enable application/pkg/server

Step 6 : Issue the below command and give a dry run to install one package. It will not actually install the package.

root@solaris11:/repo-pool/zfs1# pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F file:///repo-pool/zfs1/

root@solaris11:~# pkg install -n diffstat
Packages to install: 1
Create boot environment: No
Create backup boot environment: No

DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 6/6 0.0/0.0 0B/s

PHASE ITEMS
Installing new actions 24/24
Updating package state database Done
Updating image state Done
Creating fast lookup database Done

So we can conclude that we have configured the repository correctly 🙂

Advertisements

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