The Image Packaging System (IPS) is a framework that enables software lifecycle management, such as installation, upgrade and removal of packages. IPS also enables users to create their own software packages, create and manage package repositories, and copy and mirror existing package repositories. Packages can be installed only into file systems that are part of a boot environment (BE). For example, on a default Oracle Solaris 11 installation, only datasets under rpool/ROOT/BEname/ are supported for package operations.
Using IPS, you can perform the following tasks:
- Create and manage images.
- Search the IPS packages on your system and in IPS repositories.
- Copy, mirror, create, and administer package repositories.
- Create and publish IPS packages to a package repository.
IPS is the packaging system for the Oracle Solaris 11 operating systems as SVR4 is the packaging system for the Oracle Solaris 10 operating systems. A key component of IPS is the package repository. A package repository is a location where software packages are stored and from where packages are retrieved by client systems. You can even clone an entire package repository, such that any package repository that the client can access has everything they need to proceed.
IPS is made up of the following key components. Each component has a role to play.
A package in IPS is a collection of actions defined by a set of key-value pairs that represent metadata, such as classification, descriptions, or other attributes such as path and alias. The key-value pair can also represent a data payload. These actions can represent items, such as directories, links, drivers, and services. Each IPS package is represented by a Fault Management Resource Identifier (FMRI), which is used with the pkg command to indicate the packages on which to perform operations.
A repository is a location where clients publish and retrieve packages. The location is described by a uniform resource identifier (URI), such as http://pkg.oracle.com/solaris/release. A repository can contain packages from any number of publishers, such as solaris and ha-cluster. A publisher can publish to multiple repositories. A repository has an origin and zero or more cloned repositories. The repository origin is the location of a package repository that contains both package metadata (package manifests and catalogs) and package content (package files).
The FMRI includes descriptive information about the package, such as the package name, version information, and date. For example, the FMRI, pkg://firstname.lastname@example.org,5.11- 0.175.2.0.0.42.2:20140624T183919Z, consists of the following information:
– Scheme: pkg
– Publisher: solaris
– Category: developer
– Package Name: apptrace
– Component Version: 0.5.11
– Build Version: 5.11
– Branch Version: 0.175.2.0.0.42.2
– Time Stamp (when the package was published): 20140624T183919Z
A manifest describes the components and attributes that make up a package.
Client package management utility
pkg is a command-line utility that you can use to create and manage images; search package data; and perform software installation, upgrade, and removal.
A boot environment (BE) is a bootable image of an Oracle Solaris 11 operating system plus any other application software packages installed in that image. System administrators can maintain multiple BEs in their systems, and each BE can have different software versions installed.
Local Package Repository
The default system installation manifest installs the Oracle Solaris 11 operating system from the public repository at http://pkg.oracle.com/solaris/release/. If you have an Oracle support contract, post the installation, you can change the default manifest to use the Oracle support repository. You can also add additional publishers and repositories, such as those for Oracle Exadata, Oracle Solaris Cluster, and Oracle Solaris Studio.
You can create your own local package repository. Having a local package repository is necessary when your network clients do not have access to the web-based default repository. Other reasons you might want to have a local copy of a package repository include:
- Performance: Having a local package repository allows clients access to packages at local network speeds.
- Security: You might not want your client systems to have access to the Internet.
- Replication: You want to ensure that an installation that you perform next year is exactly the same as the installation you perform today.
Creating a Local Repository
1. Obtain the repository files.
When creating a local package repository, you first download the Oracle Solaris 11 repository files from: http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html
The repository files provide you with a complete archive of software packages, which allow you to set up a local network IPS repository to which client systems can connect.
Download the following repository files:
– README file (README-zipped-repo.txt)
– Repository assembly script (install-repo.ksh)
– MD5 checksum file
– Four IPS repository parts (zip files)
2. Make the installation script file executable.
# cd /opt/ora/repodir ### download directory # chmod +x install-repo.ksh
3. Create a ZFS file system for the repository.
A good practice is to store the repository in a separate ZFS file system with compression enabled.
# zfs create –o compression=on –o atime=off rpool/export/IPSpkgrepos # zfs create rpool/export/IPSpkgrepos/Solaris
4. Run the repository installation script, install-repo.ksh.
# ./install-repo.ksh -d /export/IPSpkgrepos/Solaris -c -v -I Comparing checksums of downloaded files...done. Checksums match. Uncompressing sol-11_2-repo-1of4.zip...done. Uncompressing sol-11_2-repo-2of4.zip...done. Uncompressing sol-11_2-repo-3of4.zip...done. Uncompressing sol-11_2-repo-4of4.zip...done. Repository can be found in /export/IPSpkgrepos/Solaris. Initiating repository verification. Building ISO image...done. ISO image and instructions for using the ISO image are at: /opt/ora/repodir/sol-11_2-repo.iso /opt/ora/repodir/README-repo-iso.txt
5. Configure the publisher.
The publisher for the Oracle Solaris 11 operating system is solaris and the default origin for that publisher is http://pkg.oracle.com/solaris/release. If you want your clients to get packages from your local repository, you must reset the origin for the solaris publisher as shown in the section “Configuring the IPS Clients” later in this post.
Enabling Users to Retrieve Packages Using an HTTP Interface
After creating a local IPS repository, you need to create a depot server instance to provide network access to the data contained within a package repository. You could configure the default instance of the service.
To create and configure a new depot server instance, perform the following steps:
1. Create a depot server instance of the pkg/server service, named solaris:
# svccfg -s pkg/server add solaris
2. Set the path where the pkg/server:solaris instance can find the repository data:
# svccfg -s pkg/server:solaris setprop pkg/inst_root=/export/IPSpkgrepos/Solaris
3. Set the port number on which the depot server instance should listen for incoming package requests (optional):
# svccfg -s pkg/server:solaris setprop pkg/port=81
4. Restart the package depot server service:
# svcadm refresh pkg/server:solaris # svcadm enable pkg/server:solaris
5. Test whether the repository server is working by opening a browser window on the localhost location.
Configuring the IPS Clients
For client systems to access a local repository, you must set the publisher to the local IPS publisher as shown in the example below. Here, s11-server1.mydomain.com is the FQDN name of the Oracle Solaris 11 system on which you configured a depot server instance.
# pkg publisher PUBLISHER TYPE STATUS P URI solaris origin online F http://pkg.oracle.com/solaris/release/
# pkg set-publisher –G http://pkg.oracle.com/solaris/release/ -g http://s11-server1.mydomain.com/ solaris
# pkg publisher PUBLISHER TYPE STATUS P URI solaris origin online F http://s11-server1.mydomain.com/
Updating the Local Master Repository Automatically
You can use the svc:/application/pkg/mirror SMF service to automatically update the local master repository from the Oracle support repository. By default, the svc:/application/pkg/mirror SMF service performs a periodic pkgrecv operation from the solaris publisher origins defined in this image to /var/share/pkg/repositories/solaris. This pkgrecv operation starts at 2:30 AM one day each month. Therefore, in a data center environment, only one system needs to have an Internet publisher origin and run the mirror service to automatically receive updates. Other systems can set their publisher origin to this repository and then they too will always have the latest update, at least once a month. For more information, refer to http://docs.oracle.com/cd/E36784_01/html/E36805/pkgmirror.html#scrolltoc.
Solaris 11 IPS hand-on LAB – Managing software Packages
Solaris 11 IPS hand-on LAB – Creating IPS repository