|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris 11.1 Administration: Oracle Solaris Zones, Oracle Solaris 10 Zones, and Resource Management Oracle Solaris 11.1 Information Library|
# pkg install package_name
The pkg install command is used in the global zone to add the package to the global zone only. The package is not propagated to any other zones.
The pkg install command is used by the zone administrator in the non-global zone to add the package to the non-global zone only. To add a package in a specified non-global zone, execute the pkg install command as the zone administrator.
Package dependencies are handled automatically in IPS.
The process of adding extra software in a zone at installation can be automated by revising the AI manifest. The specified packages and the packages on which they depend will be installed. The default list of packages is obtained from the AI manifest. The default AI manifest is /usr/share/auto_install/manifest/zone_default.xml. See Adding and Updating Oracle Solaris 11.1 Software Packages for information on locating and working with packages.
Example 24-1 Revising the Manifest
The following procedure adds mercurial and a full installation of the vim editor to a configured zone named my-zone. (Note that only the minimal vim-core that is part of solaris-small-server is installed by default.)
Copy the default AI manifest to the location where you will edit the file, and make the file writable.
# cp /usr/share/auto_install/manifest/zone_default.xml ~/my-zone-ai.xml # chmod 644 ~/my-zone-ai.xml
Edit the file, adding the mercurial and vim packages to the software_data section as follows:
<software_data action="install"> <name>pkg:/group/system/solaris-small-server</name> <name>pkg:/developer/versioning/mercurial</name> <name>pkg:/editor/vim</name> </software_data>
Install the zone.
# zoneadm -z my-zone install -m ~/my-zone-ai.xml
The system displays:
A ZFS file system has been created for this zone. Progress being logged to /var/log/zones/zoneadm.20111113T004303Z.my-zone.install Image: Preparing at /zones/my-zone/root. Install Log: /system/volatile/install.15496/install_log AI Manifest: /tmp/manifest.xml.XfaWpE SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml Zonename: my-zone Installation: Starting ... Creating IPS image Installing packages from: solaris origin: http://localhost:1008/solaris/54453f3545de891d4daa841ddb3c844fe8804f55/ DOWNLOAD PKGS FILES XFER (MB) Completed 169/169 34047/34047 185.6/185.6 PHASE ACTIONS Install Phase 46498/46498 PHASE ITEMS Package State Update Phase 169/169 Image State Update Phase 2/2 Installation: Succeeded ...