Solaris 11 IPS hand-on LAB – Managing software Packages
Solaris 11 IPS hand-on LAB – Boot environments
Oracle Solaris 11 uses a completely new approach for package management. Now with Image packaging system (IPS) a system administrator can install, update and search packages from local or remote repository. The repository can be accessed with both command line and GUI interface.
The repository can be any one of the following :
1. Local repository
2. Remote repository in local network
3. Internet repository
Although a remote repository in a local network is a common practice in production setups as this gives a central repository and security and complete control.
Advantages of IPS:
1. Auto software dependency checking and validation.
2. Uses ZFS snapshot and clones features for creating instant backups and roll-backs in case any issue arises.
3. Easy replication of exact same set of softwares across many client versions.
4. Allows you to easily search, list, install, update, remove software packages for Solaris 11.
5. Create and manage boot environments.
1. Manifest : describes an IPS package
2. Repository : location either local or remote where packages are stored. The location is specified by Universal Resource Identifier (URI)
3. Publisher : Person or organization that provides the packages.
4. Image : Location where IPS package can be installed.
5. Catalog : Lists all the packages in a repository
6. Package archive : File containing publisher information and packages provided by the publisher
7. Boot environment : Bootable instance of an Image
7. Origin : Repository with both package metadata and package content.
9. Mirror : Repository that contains only package content. Similar to a download mirror to a file on the Internet. A secondary repository you may say.
Creating a Local IPS repository
1. Create a separate ZFS filesystem for repository
Create a dedicated filesystem for storing the IPS repository.
# zpool create sol_11_repo c1t2d0 # zfs set atime=off sol_11_repo # zfs set compression=on sol_11_repo
The atime property do not update the access time of the files, thus reducing the write traffic when reading the files.
# zpool list sol_11_repo NAME SIZE ALLOC FREE CAP HEALTH ALTROOT sol_11_repo 14.9G 91K 14.9G 0% ONLINE -
# df -h /sol_11_repo Filesystem size used avail capacity Mounted on sol_11_repo 15G 31K 15G 1% /sol_11_repo
2. Download, extract the repository
Now download the iso image of the repository from oracle site. It comes in 2 parts, so we have to combine it together as follows :
# cat sol-11_1-repo-full.iso-a sol-11_1-repo-full.iso-b > sol-11_1-repo-full.iso
Now mount the iso image on /mnt
# mount -F hsfs `lofiadm /tmp/sol-11_1-repo-full.iso` /mnt
Copy all the files in the repository to the mount point we created for the repository.
# sudo rsync -avz /mnt/repo/* /sol_11_repo/
We can now umount the mount point /mnt and remove the iso image.
# umount /mnt # rm -fr /tmp/sol-11_1-repo-full.iso
3. Creating the repository
Create the infrastructure for the repository using the pkgrepo command.
# pkgrepo create /sol_11_repo
4. Build a search index
The repository creation command does not build the search index by default, so we need to create one
# pkgrepo -s /sol_11_repo refresh Initiating repository refresh.
5. Enable Clients to access the Repository
To enable the client systems to get packages from the repository we have to set the origin for the publisher. To check the publisher of the repository we just created :
# pkgrepo -s /sol_11_repo/ info PUBLISHER PACKAGES STATUS UPDATED solaris 4401 online 2012-09-27T22:22:59.530981Z
As shown above the Publisher for the repository is solaris. Fire the below command on the local client to be able to get packages from the local repository.
# pkg set-publisher -G '*' -M '*' -g /sol_11_repo solaris -G '*' -> Removes all existing origins for the solaris publisher. -M '*' -> Removes all existing mirrors for the solaris publisher. -g -> Adds the URI of the newly-created repository as the new origin for the solaris publisher.
Now check whether your repository works fine on the local system. The pkg list command will display all the packages available in the repository.
# pkg list -g /sol_11_repo NAME (PUBLISHER) VERSION IFO FSWfontconfig-devel-docs 0.5.11-0.130 --o FSWxorg-client-docs 0.5.11-0.130 --r FSWxorg-client-programs 0.5.11-0.130 --r FSWxorg-clientlibs 0.5.11-0.130 --r FSWxorg-data 0.5.11-0.130 --r FSWxorg-devel-docs 0.5.11-0.130 --o FSWxorg-headers 0.5.11-0.130 --r FSWxwpft 0.5.11-0.130 --o FSWxwrtl 0.5.11-0.130 --r ..................
Creating a Remote IPS repository
Now the steps to create a repository which is accessible to all the systems in your production setup we have to do some extra steps in addition to what we did to configure a local IPS repository. First thing is to share the repos via NFS.
# zfs set sharenfs=on sol_11_repo
Now for the client systems to use the packages from the remote repository use the below command :
# pkg set-publisher -G '*' -M '*' -g /net/repo_server/sol_11_repo/ solaris repo_server -> this is the central repository server -G '*' -> Removes all existing origins for the solaris publisher. -M '*' -> Removes all existing mirrors for the solaris publisher. -g -> Adds the URI of the newly-created repository as the new origin for the solaris publisher.
To check if we can list the packages use the command :
# pkg list -g /sol_11_repo
Using the default repository
Now every solaris 11 system is configured to have a default publisher solaris, which uses the public “release” repository : http://pkg.oracle.com/solaris/release. You don’t have to create this repository. If you have an internet connection to the solaris 11 host you can use this repository by default if you have not configured any other local repository. The public repository is not generally used in production as it is not secure, not customizable like the local repositories.
Updating an IPS repository
The local repositories must be updated to have the latest softwares. The update only copies the updated software files. This can be done in 2 ways :
1. Directly from the Public repository
I am using environment variables here, otherwise we can do it the other way by giving the source and destination in the pkgrecv command.
# export PKG_SRC=http://pkg.oracle.com/solaris/release/ # export PKG_DEST=/sol_11_repo # pkgrecv '*'
2. Updating from a local repository
# pkgrecv -s 192.168.1.10:/sol_11_depo -d /sol_11_repo '*'
I hope the post was informative. Stay tuned for the next part in the hands-on series on IPS.