|
|||
|
1. Getting Started With OpenSolaris 2008.05 2. Getting Started With the Image Packaging System Installing Developer Software (Tasks) |
IPS for End Users (Tasks)The following section provides information for end users to install, upgrade, search, and manage packages in the IPS repository. Installing, Upgrading, and Managing PackagesThe pkg(1) command is the retrieval client for the image packaging system. pkg(1) can be invoked to perform the following actions :
Refer to the pkg(1) Command Reference and the pkg(1) man page to learn more about the subcommands and options for the pkg(1) command. pkg(1) Uses FMRIsEach IPS package is represented by a Fault Management Resource Identifier (FMRI). Thepkg(1) command uses valid FMRI package information to perform its command actions. The FMRI includes descriptive information about the package, such as the package name, version information, and date. For example, the FMRI, pkg://opensolaris.org/library/libc@5.11,5.11-0.75:20071001T163427Z, consists of the following sequence of information :
Creating ImagesThe pkg(1) command is used to create an image. An installed OpenSolaris 2008.05 release on your system, constitutes an image. Packages can be installed directly within this image. New images are created to mark a boundary between the packages installed in different images. The image-create command sets up a relationship between the image and a server that can be accessed to add packages to the image. Images can be of three types:
How to Create an ImageBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command. Ensure that you have write privileges to the directory where you are attempting to create an image.
In this example, a full image is created with a repository server, http://pkg.example.com, set as the preferred authority. The image is created in the directory, /aux0/example_root. The -a option is used to specify a server such as http://pkg.example.com:10000. $ pfexec pkg image-create -F -a example.com=http://pkg.example.com:10000 /aux0/example_root How to Perform a Dry-Run Installation Inside a New ImageBefore installing packages, you have the option to perform a dry run installation. A dry run enables you to execute the command without making persistent changes to the image. The dry run option does not install any packages and only shows the changes that are made if the packages are installed. Before You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
The following example shows a dry-run (-n) installation of the SUNWzsh package with verbose (-v) output. $ pkg install -nv SUNWzsh UNEVALUATED:+pkg:/SUNWzsh@4.2.5,5.11-0.75:20071019T203321Z one -> pkg:/SUNWlibms@0.5.11,5.11-0.75:20071024T204210Z [dir, file, link, and other actions for each resource delivered by this package and succeeding packages omitted] None -> pkg:/SUNWzlib@1.2.3,5.11-0.75:20071024T204906Z None -> pkg:/SUNWlxml@2.6.23,5.11-0.75:20071024T204221Z None -> pkg:/SUNWpool@0.5.11,5.11-0.75:20071024T204717Z None -> pkg:/SUNWpr@0.5.11,5.11-0.75:20071024T204720Z None -> pkg:/SUNWlibsasl@0.5.11,5.11-0.75:20071024T204217Z None -> pkg:/SUNWtls@0.5.11,5.11-0.75:20071024T202854Z None -> pkg:/SUNWopenssl@0.9.8,5.11-0.75:20071024T204623Z None -> pkg:/SUNWcsl@0.5.11,5.11-0.75:20071024T202529Z None -> pkg:/SUNWlibC@0.5.11,5.11-0.75:20071024T204202Z None -> pkg:/SUNWpcre@7.0,5.11-0.75:20071019T202909Z None -> pkg:/SUNWzsh@4.2.5,5.11-0.75:20071019T203321Z How to Install a PackageBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
This example installs a SUNWphp524-mysql package. The output displays the status of the download, number of packages that were installed, number of files that were installed and the size (in megabytes) of the download. $ pfexec pkg install SUNWphp524-mysql DOWNLOAD PKGS FILES XFER (MB) Completed 3/3 301/301 123.70/123.70 PHASE ACTIONS Update Phase 2/2 Install Phase 404/404Example 2-4 Install a Package From a Different Repository See the How to Add or Update an Authority section to set an authority. The package is then installed from the set authority. This example installs the SUNWphp524-mysql package from the http://example.opensolaris.org authority. $ pfexec pkg install pkg:/example.opensolaris.org/SUNWphp524-mysql How to Verify a Package InstallationBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
In this example, the installation of SUNWphp524-mysql package is verified. $ pkg verify -v SUNWphp524-mysql PACKAGE STATUS pkg:/SUNWphp524-mysql OK How to Search for PackagesBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command. Note - If you are searching for a package in a remote repository, switch to root user and run the pkg refresh command to retrieve updated contents of the repository associated with the current image.
The following example searches and locates the SUNWbash package in the installed image. $ pkg search SUNWbash legacy_pkg legacy SUNWbash pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506ZExample 2-7 Search for a Package in a Remote Repository In this example, the pkg search command searches for the token bge in the remote (-r) repository associated with the current image. $ pkg search -r bge basename pkg:/SUNWbge@0.5.11,5.11-0.75:20071114T203134Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.75:20071114T203134Z basename pkg:/SUNWbge@0.5.11,5.11-0.79:20080205T180828Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.79:20080205T180828Z basename pkg:/SUNWbge@0.5.11,5.11-0.75:20071031T180039Z driver_name pkg:/SUNWbge@0.5.11,5.11-0.75:20071031T180039Z How to Update All Installed PackagesBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
See AlsoThe pkg image-update command can also be used to upgrade an installed boot environment. For more information, see the Upgrading a Boot Environment section. How to Display the State of PackagesBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
The following example shows the status of the SUNWbash package with the -v option, which displays the full FMRI information. This example shows information only about the installed SUNWbash package. $ pkg list -v SUNWbash FMRI STATE UFIX pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z installed ----Example 2-9 Displaying the State of All Instances of a Package This example shows the state of all instances of the SUNWbash package. $ pkg list -a SUNWbash NAME (AUTHORITY) VERSION STATE UFIX SUNWbash 3.2.25-0.86 installed ---- SUNWbash 3.2.25-0.79 known u--- SUNWbash 3.2.25-0.75 known u--- SUNWbash 3.2.25-0.75 known u--- How to List the Action Attributes of a PackageBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command. See the Actions in IPS section to become familiar with the actions associated with a package.
In this example, we will list the name, mode of the file, size, path and the target of the following actions in the zfs package:
$ pkg contents -t dir,file,link,hardlink -o action.name,mode,pkg.size,path,target zfs NAME MODE SIZE PATH TARGET
dir 0755 etc
dir 0755 etc/fs
dir 0755 etc/fs/zfs
link etc/fs/zfs/mount ../../../sbin/zfs
link etc/fs/zfs/umount ../../../sbin/zfs
dir 0755 etc/zfs
dir 0755 lib
dir 0755 lib/amd64
link lib/amd64/libzfs.so libzfs.so.1
file 0755 469616 lib/amd64/libzfs.so.1
file 0644 62057 lib/amd64/llib-lzfs.ln
link lib/libzfs.so libzfs.so.1
[ ... ]Example 2-11 Displaying Complete Contents of a PackageThis example uses the -m option with the pkg contents command to display all actions of the SUNWbash package. $ pkg contents -m SUNWbash
set fmri = pkg://opensolaris.org
/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z
dir owner=root path=usr group=sys mode=0755
dir owner=root path=usr/bin group=bin mode=0755
dir owner=root path=usr/gnu group=bin mode=0755
dir owner=root path=usr/gnu/bin group=bin mode=0755
depend fmri=pkg:/SUNWcsl@0.5.11-0.79 type=require
file 66d09735123ad3a7bdcf7640dd60acbe843d8a13
elfhash=28106285f73f97274cf99b1a7e63d7d73c31c153 elfarch=i386 mode=0555
pkg.size=730604 owner=root group=bin path=usr/bin/bash elfbits=32
legacy category=system vendor="Sun Microsystems, Inc."
name="GNU Bourne-Again shell (bash)"
version=11.11.0,REV=2007.11.29.14.44 hotline="Please contact your local service provider"
pkg=SUNWbash arch=i386 desc="GNU Bourne-Again shell (bash) version 3.2"
license ed881c52c54b67457db33ba23a1d53615e366440 path=copyright
license=SUNWbash.copyright
transaction_id=1202253906_pkg%3A%2FSUNWbash%
403.2.25%2C5.11-0.79%3A20080205T152506Z pkg.size=1207
link path=usr/gnu/bin/sh target=../../bin/bash
set name=description value="GNU Bourne-Again shell (bash)"
set fmri = pkg://VERSION_1
/SUNWbash@3.2.25,5.11-0.79:20080205T152506Z
dir owner=root path=usr group=sys mode=0755
dir owner=root path=usr/bin group=bin mode=0755
dir owner=root path=usr/gnu group=bin mode=0755
dir owner=root path=usr/gnu/bin group=bin mode=0755
depend fmri=pkg:/SUNWcsl@0.5.11-0.79 type=require
file 66d09735123ad3a7bdcf7640dd60acbe843d8a13
elfhash=28106285f73f97274cf99b1a7e63d7d73c31c153
elfarch=i386 mode=0555 pkg.size=730604 owner=root group=bin path=usr/bin/bash elfbits=32
legacy category=system vendor="Sun Microsystems, Inc."
name="GNU Bourne-Again shell (bash)" version=11.11.0,REV=2007.11.29.14.44
hotline="Please contact your local service provider"
pkg=SUNWbash arch=i386 desc="GNU Bourne-Again shell (bash) version 3.2"
license ed881c52c54b67457db33ba23a1d53615e366440 path=copyright
license=SUNWbash.copyright
transaction_id=1202253906_pkg%3A%2FSUNWbash%403.2.25
%2C5.11-0.79%3A20080205T152506Z
pkg.size=1207
link path=usr/gnu/bin/sh target=../../bin/bash
set name=description value="GNU Bourne-Again shell (bash)"
How to List Information About a PackageBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
This example displays information about the SUNWbash package. Name: SUNWbash Summary: GNU Bourne-Again shell (bash) Authority: pkg.com (preferred) Version: 3.2.25 Build Release: 5.11 Branch: 0.79 Packaging Date: Tue Feb 5 15:25:06 2008 Size: 714 kB FMRI: pkg:/SUNWbash@3.2.25,5.11-0.79:20080205T152506ZExample 2-13 Display Copyright and License Information About a Package This example displays the copyright and license information about the SUNWGlib package. $ pkg info --license -r SUNWGlib Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. Modified by the GLib Team and others 1997-1999. See the AUTHORS file for a list of people on the GLib Team. See the ChangeLog files for a list of changes. These files are distributed with GLib at ftp://ftp.gtk.org/pub/gtk/. How to Uninstall PackagesBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
This example uninstalls the SUNWphp524-mysqlpackage. $ pfexec pkg uninstall SUNWphp524-mysql PHASE ACTIONS Removal Phase 39/39 How to Add or Update an AuthorityBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
$ pfexec pkg set-authority -O http://pkg.sunfreeware.com:80 sunfreeware.com $ pkg authority AUTHORITY URL opensolaris.org (preferred) http://pkg.opensolaris.org:80/ sunfreeware.com http://pkg.sunfreeware.com:80/Example 2-16 Setting a Preferred Authority Use the -P option to set an authority as the preferred authority. $ pfexec pkg set-authority -P http://pkg.sunfreeware.com:80 sunfreeware.com $ pkg authority AUTHORITY opensolaris.org http://pkg.opensolaris.org:80/ sunfreeware.com (preferred) http://pkg.sunfreeware.com:80/ How to Remove Authority ConfigurationBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
$ pfexec pkg unset-authority sunfreeware.com $ pkg authority AUTHORITY URL opensolaris.org (preferred) http://pkg.opensolaris.org:80/ How to Display Authority InformationBefore You BeginRefer to the pkg(1) Command Reference for a table of all the options associated with this command.
$ pkg authority AUTHORITY URL opensolaris.org (preferred) http://pkg.opensolaris.org:80/ |
||
|