How to Create Multiple Internal Repositories for Oracle Solaris 11
Posted by Sandi Widianto, Last modified by Sandi Widianto on 16 November 2022 03:18 PM
Step 1: Create a Dedicated Oracle Solaris ZFS File System
First, you create a dedicated ZFS file system for your repository on your Oracle Solaris 11 system. This allows you to use ZFS technologies, such as clones and snapshots, to easily manage your data.
We'll assume that you already have the zpool
Step 2: Create the Oracle Solaris 11 Release Repository
Next, we use
Step 3: Populate the Oracle Solaris 11 Release Repository
We now populate this repository with the contents of the official Oracle Solaris 11 release repository. For this we use
If you do not have network access to the Oracle package repository, you can use the Oracle Solaris 11 repository ISO image, as detailed in Copying a Repository From a File.
Step 4: Snapshot the Oracle Solaris 11 Release Repository
ZFS allows you to create snapshots of file systems, which makes it very easy to roll back a file system at a later date, if needed, or to copy a file system quickly. For convenience, we will create a snapshot of our repository now using the
Step 5: Start the Package Repository SMF Service
Repositories are managed in Oracle Solaris 11 by the
Listing 1 shows an example of how to configure our Release repository service. We have chosen to run the daemon on port
Listing 1. Configuring the Release Repository Service
You can also make SMF configuration changes using the
Step 6: (Optional) Configuring the Apache HTTP Server
If you choose to use an Apache HTTP server so that the package repositories can be accessed via HTTP (or HTTPS) rather than directly through the file system, you now must configure the server to map our URL (
To activate this change, you need to do one of the following:
Now that we have now created a copy of the Oracle Solaris 11 Release repository, clients can install software directly from http://pkg.example.com/s11ReleaseRepo rather than needing external network access to http://pkg.oracle.com/solaris/release/.
Creating the Support and Development Repositories
Next, we will look at creating the local Support and Development repositories. The Support repository will be used to roll out changes that you have tested across your organization, and the Development repository will be used to mirror the latest Support Repository Update (SRU) changes from Oracle.
Step 1: Cloning the Release Repository
Initially, the Support and Development repositories will be the same as the Release repository you just created. We can use zfs clone to create copies of the repository file systems rather than needing to use
Again, we will make a ZFS snapshot of these repositories for future use. It is recommended that ZFS snapshots be taken anytime new content is added to a repository to provide a convenient way to roll back to an earlier snapshot if necessary.
Step 2: Repeat the Repository Configuration
Caution : Pay careful attention to changing the repository name, path, Apache proxy base, and port number during configuration.
Populating the Development Repository
Every month or so, Oracle issues new updates to the Oracle Solaris 11 Support Repository. This repository is available only to customers with a support contract, and a support contract is required to obtain the updates.
We will use the Development repository to populate the latest changes from Oracle, either directly from the Oracle repository itself or through incremental SRU ISO images.
Using the Oracle Solaris 11 Support Repository
Obtain your SSL key and certificates from here. You will need your My Oracle Support login to download the key and certificate pair. Once they have been downloaded, you can use pkgrecv again to update the contents of the Development repository.
Remember that since we made a change to the repository, it is always a good idea to create a ZFS snapshot for our current position. The snapshot names should be meaningful, such as
If you choose to manage your repository using pkg.depod (instead of using a file-based repository), you must restart the appropriate SMF service.
Using the Oracle Solaris 11 Incremental SRU ISO Images
Alternatively, you can update your repository from the ISO images, which you can download from My Oracle Support (login required).
First, we mount the ISO image as a file system on the server:
Once we have mounted the ISO image, we can use
Next, we need to rebuild the search index for the repository to reflect the latest updates:
And, once again, we need to create a ZFS snapshot for our current position and start the SMF service, if necessary:
Populating the Internal Support Repository from the Development Repository
After performing the necessary testing on your Development repository, it is time to roll out the changes to your Support repository so users can obtain the updates. We can make these changes using the
Then we need to rebuild the search indexes for the repository, take a ZFS snapshot, and restart the appropriate SMF service:
Rolling Back to Previous Repository Snapshots
Occasionally, you might encounter a problem, which means that you cannot install a particular SRU in your environment. In this case, you will need to roll back your repository to a previous snapshot. This is easily accomplished using the ZFS rollback mechanism (the
Note : Ideally, you will not roll back changes on a repository from which systems have installed packages, because that might lead to dependency resolution problems during a system update. If dependency resolution problems occur, you will need to revert to a previous boot environment on any affected systems.