It is convenient to install packages from the official Oracle repository, but access to the Internet could become very intensive if in the company, there are a lot of installed machines with Oracle Solaris 11 that repeat the same routine to install packages. In this case, it is very handy to create a local IPS repository with the same packages from the official repository but have them available on a local network.
To follow this recipe, it's necessary that we have a machine (physical or virtual) running Oracle Solaris 11; we log in to the system as the root user and open a terminal. Additionally, our system must be able to access the Internet. There are further requirements, such as extra disk (physical or virtual), to create a Z File System (ZFS), and we have to download the repository image.
To download the repository image, go to http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html, click on Create a Local Repository, and download all the available parts (at the time of this writing, there are four parts). Extract and concatenate them by executing the following:
We can create the repository in a separated disk to get some performance and maintenance advantage. Indeed, we aren't obliged to do this, but it is greatly recommended. To list the disks that are available (the format
command), we create a new pool and then a new ZFS filesystem in this pool, and execute the following command:
We realize that if the second disk (c8t1d0
) doesn't have any partitions, then the following sequence of commands creates a pool (the zpool create
command). We list it (the zpool list
command) and create a new ZFS filesystem (the zfs create
command), as follows:
It's time to use the repository image (solaris-11-repo-full.iso
from the Getting ready section) to create our local repository, and to do this, we need to mount this image and copy all of its contents (about 6.8 GB) to the repository filesystem that we created. Therefore, in the first step, we create a mount point:
Now, we create a device file that points to the repository image using the lofiadm
command and mount it:
To copy the image content to the local repository, we run the following:
Configure the repository server service in Service Management Facility (SMF). If you still aren't comfortable with SMF, I suggest reading Chapter 5, Playing with Oracle Solaris 11 Services, later. So, the use of the svcprop
command makes it possible to verify some service properties. Likewise, the svccfg
command is appropriate if you wish to change a specific property from a service.
To verify what the current repository directory is, we execute the following command:
We change the repository directory and make it read-only by running the following command:
We quickly check our changes by running the following:
To avoid a TCP port collision with any existing service that is configured on port 80
, we change it to 9999
:
Now, we reload the repository configuration, start it, and then index the repository catalog for a better package search operation:
We list the current configured publisher and configure Oracle Solaris 11 for a new one:
We need to take care. In the preceding command, the -G
option removed any existing origins (repositories) of the solaris
publisher, and the -g
option set a new URI that points to the local repository of the same publisher (solaris
). Furthermore, the URL, solaris.example.com
, points to the local system address of the repository machine (it could be 127.0.0.1
).
We now have the opportunity to test our new repository:
Wow! We've listed the configured publishers and changed the solaris
publisher URI. Additionally, we are able to collect more information about the local repository by running the following command:
We can change any attribute of the repository, and afterwards, verify our changes by executing the following command:
Sometimes, we'll need to update our local repository from a reliable and updated source (Oracle). We execute the following command to accomplish this task:
By contrast, the most impressive fact is that we could have used this same command to copy the entire repository from the official Oracle repository at the beginning of this recipe instead of downloading the entire repository, concatenating the parts, creating a device using the lofiadm
command, executing the rsync
command, and so on. I had a personal experience when using this particular command in which, for some reason, there was a download error while I was getting packages. To continue with a download that was initially interrupted, we run the following command:
It's almost the same command, but we use the -c
option here instead.
In some situations, we want to access our local repository to get some packages, but by using another interface. To interact with our own repository, we need to open a web browser and navigate to our local repository (in my test environment, the IP address is 192.168.1.133
—solaris11.example.com
—and the port is 9999
):

In the preceding screenshot, we searched for the nmap
package, and the interface showed us that the specified package is already installed. If this is the case, we take a separate filesystem to improve the read/write performance.