Steps to build a local repository on Solaris 11 from ISO image:
- Download the full repository image from Oracle Web. It is split in two files of 3.5GB each, ¡¡watch the disk space!!. Once downloaded, join both files with cat:
# cat sol-11_1-repo-full.iso-a sol-11_1-repo-full.iso-b > sol-11_1-repo-full.iso - Search for disk spce for the repository.
Besides the space for the ISO image, we need another 7.5gb disk space to store the repository permanently. Oracle recommends to store the repository in a separate zfs, so you can share it without sharing any other thing. Here we will use: /repo/Solaris11.1/repo - Create the repository. (/repo/Solaris11.1/repo must be empty (or not even exists)).
# pkgrepo create /repo/Solaris11.1/repo - Mount full repository ISO image on /mnt with lofi
# lofiadm -a /home/sysad/sol-11_1-repo-full.iso
# mount -F hsfs /dev/lofi/1 /mnt - Copy all the contents from the ISO image to our repository
# rsync -aP /mnt/repo/ /repo/Solaris11.1/repo (¡¡it takes a while!!)
Once it's done we can umount /mnt and delete the lofi device. - Build initial index.
# pkgrepo -s /repo/Solaris11.1/repo refresh - Set up and start the package serving service.
# svccfg -s application/pkg/server setprop pkg/inst_root=/repo/Solaris11.1/repo
# svccfg -s application/pkg/server setprop pkg/readonly=true
# svcprop -p pkg/inst_root application/pkg/server (¡¡¡this one is to check!!!)
# svcadm refresh application/pkg/server
# svcadm enable application/pkg/server - Set up our system to use the local repository (¡¡ Here is the magic !!)
# pkg set-publisher -G '*' -M '*' -g http://10.228.164.100:80/ solaris
-G '*' removes any other origin for publisher solaris
-M '*' removes any other mirror for publisher solaris
-g adds a new origin for publisher solaris.
From this moment the server will not try to reach pkg.oracle.com to get software packages.
If we want to use this local repository from any other server in our network, we just need to type the above command on this other servers.
No hay comentarios:
Publicar un comentario