X

Using Solaris and SPARC Networking and Virtualization

Repo AI UAR: Step 1: Create a Solaris 11 Repository


Overview


In this section I will create a Solaris Repository and populate it with the Release and the Support Repository Update (SRU) bits. While the examples here show only Solaris 11.3, a single Repository can hold all releases of Solaris and all SRUs.

The recommendation is to put all SRUs into the repository, not just the ones you believe you will install. While this consumes more space, it may avoid problems later.

I have built a repository add SRUs out of order. While I haven't fully compared that to one created in order, a Repository verify was successful.

Create the Initial Repository


Log into the system where you will build the Repository. In my case I am doing a "zlogin repo".

I add a hostname.local to my /etc/hosts file to suppress sendmail messages.

root@repo:~# cat /etc/hosts 
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1

localhost
127.0.0.1

localhost loghost
192.168.1.101

repo repo.local
root@repo:~#

My first step is to create a new ZFS file system where I put the Repository. This allows me to snapshot, ZFS send, or any other ZFS operation on the Repository separate from the other file systems.
root@repo:~# zfs create -o mountpoint=/repo rpool/repo 
root@repo:~# zfs create rpool/repo/solaris
root@repo:~# zfs set atime=off rpool/repo/solaris
root@repo:~#

I followed the Solaris documentation to turn of access time, to reduce updates to meta data in ZFS.

Because I have downloaded the GA Solaris 11.3 repository image and all SRU repository update images to my Zlobal Zone, I can mount those into my repo Zone. This step is completely optional. You must get the repo files into your OS somehow.

global# mount -F lofs -o ro /export/iso/s11.3/ /zones/repo/root/mnt/ 
root@repo:~# ls /mnt
buildnumber ga sru02.4 sru03.6 sru04.5 sru05.6 sru06.5
root@repo:~#

The Solaris 11.3 base download files include a full Repository. This is pretty large, and thus split into five files. Separately, there is an assembly script (install-repo.sh) to download. I always use the one included in with the Repository images.

I make a point to do a verify on the initial installation using the "-v" option. The verification takes a long time. By long I mean 30-60 minutes on a 3GHz x86 system with mirrored 7200RPM 2TB SATA disks. I will also do this after every few SRUs.

root@repo:/mnt/ga/zipped-repo# ./install-repo.ksh -d /repo/solaris/ -v 
Using sol-11_3_1_5_0-repo download.
Uncompressing sol-11_3_1_5_0-repo_1of5.zip...done.
Uncompressing sol-11_3_1_5_0-repo_2of5.zip...done.
Uncompressing sol-11_3_1_5_0-repo_3of5.zip...done.
Uncompressing sol-11_3_1_5_0-repo_4of5.zip...done.
Uncompressing sol-11_3_1_5_0-repo_5of5.zip...done.
Repository can be found in /repo/solaris/.
Initiating repository verification.
root@repo:/mnt/ga/zipped-repo#

Populate the Repository with Monthly Support Repository Updates (SRUs)


Once the base Repository is in place, it is an iterative process to apply each SRU. In my case I have separate directories for each SRU, and I just walk though each one. I don't verify to save time.
root@repo:/mnt/ga/zipped-repo# 
root@repo:/mnt/ga/zipped-repo# cd /mnt/sru02.4/zipped-repo/
root@repo:/mnt/sru02.4/zipped-repo#
root@repo:/mnt/sru02.4/zipped-repo# ./install-repo.ksh -d /repo/solaris/
Using sol-11_3_2_4_0-incr-repo download.
IPS repository exists at destination /repo/solaris/
Current version: 0.175.3.1.0.5.0
Do you want to add to this repository? (y/n)[n]: y
Uncompressing sol-11_3_2_4_0-incr-repo.zip...done.
Repository can be found in /repo/solaris/.
Initiating repository rebuild.
root@repo:/mnt/sru02.4/zipped-repo#

You may have noticed that I am prompted to verify I want to add to an existing Repository. This is my check that I have the path to the Repository correct.

For the next SRUs, I will override that check with the "-y" option.

root@repo:/mnt/sru02.4/zipped-repo# cd /mnt/sru03.6/zipped-repo/ 
root@repo:/mnt/sru03.6/zipped-repo#
root@repo:/mnt/sru03.6/zipped-repo# ./install-repo.ksh -d /repo/solaris/ -y
Using sol-11_3_3_6_0-incr-repo download.
IPS repository exists at destination /repo/solaris/
Current version: 0.175.3.2.0.4.0
Adding packages to existing repository.
Uncompressing sol-11_3_3_6_0-incr-repo_1of2.zip...done.
Uncompressing sol-11_3_3_6_0-incr-repo_2of2.zip...done.
Repository can be found in /repo/solaris/.
Initiating repository rebuild.
root@repo:/mnt/sru03.6/zipped-repo#

The current SRU level for Solaris 11.3 at this writing is 6.5, however, I will stop at 5.6 to be able to show effects of updating both the repository and an installed image.

My system is running Solaris 11.3 SRU 6.5. This highlights that a Repository and its contents is completely independent of what the system is running at.

root@repo:/mnt/sru05.6/zipped-repo# pkg list entire 
NAME (PUBLISHER) VERSION IFO
entire 0.5.11-0.175.3.6.0.5.0 i--
root@repo:/mnt/sru05.6/zipped-repo# pkg info entire
Name: entire
Summary: entire incorporation including Support Repository Update (Oracle Solaris 11.3.6.5.0).
Description: This package constrains system package versions to the same
build. WARNING: Proper system update and correct package
selection depend on the presence of this incorporation.
Removing this package will result in an unsupported system. For
more information see:
https://support.oracle.com/rs?type=doc&id=2045311.1
Category: Meta Packages/Incorporations
State: Installed
Publisher: solaris
Version: 0.5.11 (Oracle Solaris 11.3.6.5.0)
Build Release: 5.11
Branch: 0.175.3.6.0.5.0
Packaging Date: March 9, 2016 10:05:55 PM
Size: 5.46 kB
FMRI: pkg://solaris/entire@0.5.11,5.11-0.175.3.6.0.5.0:20160309T220555Z
root@repo:/mnt/sru05.6/zipped-repo#

Create the Repository Server


I have install GA and four SRUs into the repository, yet I have not really created a repository server yet.
root@repo:~# pkg search -s http://192.168.1.101 entire 
pkg: Some repositories failed to respond appropriately:
http://10.143.156.62:
Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
Framework error: code: 7 reason: Failed to connect to 192.168.1.101 port 80: Connection refused
URL: 'http://192.168.1.101' (happened 4 times)
root@repo:~#

So a quick check of what the system is listening to shows no port 80.
root@repo:~# netstat -anf inet 
...
TCP: IPv4
Local Address Remote Address Swind Send-Q Rwind Recv-Q State
-------------------- -------------------- ------- ------ ------- ------ -----------
127.0.0.1.5999 *.* 0 0 128000 0 LISTEN
*.111 *.* 0 0 128000 0 LISTEN
*.* *.* 0 0 128000 0 IDLE
*.111 *.* 0 0 128000 0 LISTEN
*.* *.* 0 0 128000 0 IDLE
*.22 *.* 0 0 128000 0 LISTEN
*.22 *.* 0 0 128000 0 LISTEN
127.0.0.1.4999 *.* 0 0 128000 0 LISTEN
127.0.0.1.25 *.* 0 0 128000 0 LISTEN
127.0.0.1.587 *.* 0 0 128000 0 LISTEN
root@repo:~#

I need to set up some base configuration details to run the server. I am calling this instance "solaris" and setting the location of the Repository.
root@repo:~# svccfg -s pkg/server add solaris 
root@repo:~# svccfg -s pkg/server:solaris setprop pkg/inst_root=/repo/solaris/
root@repo:~# svcadm refresh pkg/server:solaris
root@repo:~# svcadm enable pkg/server:solaris
root@repo:~# svcs server:solaris
STATE STIME FMRI
online 8:10:50 svc:/application/pkg/server:solaris
root@repo:~#
root@repo:~# netstat -anf inet
...
TCP: IPv4
Local Address Remote Address Swind Send-Q Rwind Recv-Q State
-------------------- -------------------- ------- ------ ------- ------ -----------
127.0.0.1.5999 *.* 0 0 128000 0 LISTEN
*.111 *.* 0 0 128000 0 LISTEN
*.* *.* 0 0 128000 0 IDLE
*.111 *.* 0 0 128000 0 LISTEN
*.* *.* 0 0 128000 0 IDLE
*.22 *.* 0 0 128000 0 LISTEN
*.22 *.* 0 0 128000 0 LISTEN
127.0.0.1.4999 *.* 0 0 128000 0 LISTEN
127.0.0.1.25 *.* 0 0 128000 0 LISTEN
127.0.0.1.587 *.* 0 0 128000 0 LISTEN
*.80 *.* 0 0 128000 0 LISTEN
127.0.0.1.32945 127.0.0.1.80 130880 0 139264 0 TIME_WAIT
root@repo:~#

After enabling the service with svcadm see that it is running and can see something is listening on the default port 80. This is one reason I like to run it in a Zone, as it won't conflict with any other HTTP server that may be running on my system.

Now if I search again, success.

root@repo:~# pkg search -s http://192.168.1.101 entire 
INDEX ACTION VALUE PACKAGE
require depend pkg://solaris/entire@0.5.11,5.11-0.175.3.4.0.5.0 pkg:/support/critical-patch-update/solaris-11-cpu@2016.1-1
require depend pkg://solaris/entire@0.5.11,5.11-0.175.3.2.0.4.0 pkg:/support/critical-patch-update/solaris-11-cpu@2015.11-1
require depend pkg://solaris/entire@0.5.11,5.11-0.175.3.5.0.6.0 pkg:/support/critical-patch-update/solaris-11-cpu@2016.2-1
require depend pkg://solaris/entire@0.5.11,5.11-0.175.3.3.0.6.0 pkg:/support/critical-patch-update/solaris-11-cpu@2015.12-1
pkg.description set Provides for power management support of the entire operating system, including the configuration of the maximum time allowed to reach both minimum and full capacity, and whether or not to permit system suspend and resume if the platform supports it. pkg:/system/kernel/power@0.5.11-0.175.3.0.0.30.0
pkg.description set pixz compresses and decompresses files using multiple processors. If the input looks like a tar(1) archive, it also creates an index of all the files in the archive. This allows the extraction of only a small segment of the tarball, without needing to decompress the entire archive. pkg:/compress/pixz@1.0-0.175.3.0.0.30.0
root@repo:~#

So my initial Repository setup is complete, and I can see I have four SRUs installed. Later I may add another SRU.

Appendix A: Verifying the Repository Manually


In my introduction to this section I mention manually verifying the repository. The step is simply.
root@repo:~# pkgrepo -s /repo/solaris/repo verify 
Initiating repository verification.
Scanning repository (this could take some time)

The verification can take a long time, possibly half an hour or longer, depending on the speed of your system.

Revision History

(Other than minor typographical changes)

2016.10.26: Posted

2016.04.21: Created

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.