|
|||
1. Solaris Management Tools (Road Map) 2. Working With the Solaris Management Console (Tasks) 3. Working With the Sun Java Web Console (Tasks) 4. Managing User Accounts and Groups (Overview) 5. Managing User Accounts and Groups (Tasks) 6. Managing Client-Server Support (Overview) 7. Managing Diskless Clients (Tasks) 8. Introduction to Shutting Down and Booting a System 9. Shutting Down and Booting a System (Overview) 10. Shutting Down a System (Tasks) 11. Modifying Solaris Boot Behavior (Tasks) 12. Booting a Solaris System (Tasks) 13. Troubleshooting Booting a Solaris System (Tasks) 14. Managing the Solaris Boot Archives (Tasks) 15. x86: GRUB Based Booting (Reference) 16. Managing Services (Overview) 18. Managing Software (Overview) 19. Managing Software With Solaris System Administration Tools (Tasks) 20. Managing Software by Using Package Commands (Tasks) Adding and Removing Signed Packages by Using the pkgadd Command (Task Map) Adding and Removing Signed Packages by Using the pkgadd Command Managing Software Packages by Using Package Commands (Task Map) 21. Managing Solaris Patches by Using the patchadd Command (Tasks) |
Using Package Commands to Manage Software PackagesThe following procedures explain how to manage software packages by using package commands. How to Add Software Packages (pkgadd)
Example 20-5 Adding Software Packages From a Mounted CDThe following example shows how install the SUNWpl5u package from a mounted Solaris 10 CD. The example also shows how to verify that the package files were installed properly. # pkgadd -d /media/Solaris_11/Product SUNWpl5u . . . Installation of <SUNWpl5u> was successful. # pkgchk -v SUNWpl5u /usr /usr/bin /usr/bin/perl /usr/perl5 /usr/perl5/5.8.4 . . . Example 20-6 Installing Software Packages From a Remote Package ServerIf the packages you want to install are available from a remote system, you can manually mount the directory that contains the packages (in package format) and install packages on the local system. The following example shows how to install software packages from a remote system. In this example, assume that the remote system named package-server has software packages in the /latest-packages directory. The mount command mounts the packages locally on /mnt. The pkgadd command installs the SUNWpl5u package. # mount -F nfs -o ro package-server:/latest-packages /mnt # pkgadd -d /mnt SUNWpl5u . . . Installation of <SUNWpl5u> was successful. If the automounter is running at your site, you do not need to mount the remote package server manually. Instead, use the automounter path, in this case, /net/package-server/latest-packages, as the argument to the -d option. # pkgadd -d /net/package-server/latest-packages SUNWpl5u . . . Installation of <SUNWpl5u> was successful. Example 20-7 Installing Software Packages From a Remote Package Server by Specifying an Administration FileThis example is similar to the previous example, except that it uses the -a option and specifies an administration file named noask-pkgadd, which is illustrated in Avoiding User Interaction When Adding Packages (pkgadd). In this example, assume that the noask-pkgadd administration file is in the default location, /var/sadm/install/admin. # pkgadd -a noask-pkgadd -d /net/package-server/latest-packages SUNWpl5u . . . Installation of <SUNWpl5u> was successful. Example 20-8 Installing Software Packages From an HTTP URLThe following example shows how to install a package using an HTTP URL as the device name. The URL must point to a stream-formatted package. # pkgadd -d http://install/xf86-4.3.0-video.pkg ## Downloading... ..............25%..............50%..............75%..............100% ## Download Complete The following packages are available: 1 SUNWxf86r XFree86 Driver Porting Kit (Root) (i386) 4.3.0,REV=0.2003.02.28 2 SUNWxf86u XFree86 Driver Porting Kit (User) (i386) 4.3.0,REV=0.2003.02.28 . . . Adding a Software Package to a Spool DirectoryFor convenience, you can copy frequently installed packages to a spool directory. If you copy packages to the default spool directory, /var/spool/pkg, you do not need to specify the source location of the package (-d device-name argument) when you use the pkgadd command. The pkgadd command, by default, checks the /var/spool/pkg directory for any packages that are specified on the command line. Note that copying packages to a spool directory is not the same as installing the packages on a system. How to Add Software Packages to a Spool Directory (pkgadd)
Example 20-9 Setting Up a Spool Directory From a Mounted CDThe following example shows how to transfer the SUNWman package from a mounted SPARC based Solaris 10 CD to the default spool directory (/var/spool/pkg). # pkgadd -d /media/Solaris_11/Product -s /var/spool/pkg SUNWman Transferring <SUNWman> package instance Example 20-10 Setting Up a Spool Directory From a Remote Software Package ServerIf packages you want to copy are available from a remote system, you can manually mount the directory that contains the packages, in package format, and copy them to a local spool directory. The following example shows the commands for this scenario. In this example, assume that the remote system named package-server has software packages in the /latest-packages directory. The mount command mounts the package directory locally on /mnt. The pkgadd command copies the SUNWpl5p package from /mnt to the default spool directory (/var/spool/pkg). # mount -F nfs -o ro package-server:/latest-packages /mnt # pkgadd -d /mnt -s /var/spool/pkg SUNWpl5p Transferring <SUNWpl5p> package instance If the automounter is running at your site, you do not have to mount the remote package server manually. Instead, use the automounter path, in this case, /net/package-server/latest-packages, as the argument to the -d option. # pkgadd -d /net/package-server/latest-packages -s /var/spool/pkg SUNWpl5p Transferring <SUNWpl5p> package instance Example 20-11 Installing Software Packages From the Default Spool DirectoryThe following example shows how to install the SUNWpl5p package from the default spool directory. When no options are used, the pkgadd command searches the /var/spool/pkg directory for the named packages. # pkgadd SUNWpl5p . . . Installation of <SUNWpl5p> was successful. How to List Information About All Installed Packages (pkginfo)Example 20-12 Listing Installed PackagesThis example shows how to list all packages installed on a local system, whether that system is a stand-alone system or a server. The output shows the primary category, package name, and the description of the package. $ pkginfo system SUNWaccr System Accounting, (Root) system SUNWaccu System Accounting, (Usr) system SUNWadmap System administration applications system SUNWadmc System administration core libraries . . . Example 20-13 Displaying Detailed Information About Software PackagesThis example shows how to list all packages installed on a system by specifying the long format, which includes all available information about the designated packages. $ pkginfo -l SUNWcar PKGINST: SUNWcar NAME: Core Architecture, (Root) CATEGORY: system ARCH: sparc.sun4u VERSION: 11.9.0,REV=2002.04.06.15.27 BASEDIR: / VENDOR: Sun Microsystems, Inc. DESC: core software for a specific hardware platform group PSTAMP: leo20031003183400 INSTDATE: Feb 20 2004 16:57 HOTLINE: Please contact your local service provider STATUS: completely installed FILES: 114 installed pathnames 36 shared pathnames 40 directories 57 executables 21469 blocks used (approx) How to Check the Integrity of Installed Software Packages (pkgchk)
Example 20-14 Checking the Contents of Installed Software PackagesThe following example shows how to check the contents of a package. # pkgchk -c SUNWbash If no errors occur, the system prompt is returned. Otherwise, the pkgck command reports the error. Example 20-15 Checking the File Attributes of Installed Software PackagesThe following example shows how to check the file attributes of a package. # pkgchk -a SUNWbash If no errors occur, the system prompt is returned. Otherwise, the pkgck command reports the error. Example 20-16 Checking Software Packages Installed in a Spool DirectoryThe following example shows how to check a software package that was copied to a spool directory (/export/install/packages). # pkgchk -d /export/install/packages ## checking spooled package <SUNWadmap> ## checking spooled package <SUNWadmfw> ## checking spooled package <SUNWadmc> ## checking spooled package <SUNWsadml> The checks made on a spooled package are limited because not all information can be audited until a package is installed. How to Check the Integrity of Installed Objects (pkgchk -p, pkgchk -P)This procedure explains how to use the pkgchk command to check the integrity of installed objects. The new -P option enables you to specify a partial path. This option has been added to assist you in mapping files to packages. Use this option with the -l option to list the information about the files that contain the partial path. Use the -p option to check the integrity of installed objects by specifying the full path. For more information, see the pkgchk(1M) man page.
Example 20-17 Checking the Integrity of an Installed Object by Specifying a Full Path NameThis example shows you how to use the pkgchk -lp command to check the contents/attributes of an object on a file system by a specifying the full path name. The -l option lists information on the selected files that make up a package. # pkgchk -lp /usr/sbin/pkgadd Pathname: /usr/sbin/pkgadd Type: regular file Expected mode: 0555 Expected owner: root Expected group: sys Expected file size (bytes): 867152 Expected sum(1) of contents: 45580 Expected last modification: Jul 02 02:20:34 2004 Referenced by the following packages: SUNWpkgcmdsu Current status: installed Example 20-18 Checking the Integrity of an Installed Object by Specifying a Partial Path NameThis example shows you how to use the pkgchk -lP command to check the contents/attributes of an object on a file system by a specifying a partial path name, such as a file or directory name. The -l option lists information on the selected files that make up a package. # pkgchk -lP /sbin/pkgadd Pathname: /usr/sbin/pkgadd Type: regular file Expected mode: 0555 Expected owner: root Expected group: sys Expected file size (bytes): 867152 Expected sum(1) of contents: 45580 Expected last modification: Jul 02 02:20:34 2004 Referenced by the following packages: SUNWpkgcmdsu Current status: installed Pathname: /usr/sbin/pkgask Type: linked file Source of link: ../../usr/sbin/pkgadd Referenced by the following packages: SUNWpkgcmdsu Current status: installed Removing Software PackagesTo remove or uninstall a software package, use the associated tool that you used to add or install a software package. For example, if you used the Solaris installation GUI to install software, use the Solaris installation GUI to uninstall software. Caution - Do no use the rm command to remove software packages. Doing so will result in inaccuracies in the database that keeps track of all installed packages on the system. How to Remove Software Packages (pkgrm)
Example 20-19 Removing Software PackagesThis example shows how to remove a package. # pkgrm SUNWctu The following package is currently installed: SUNWctu Netra ct usr/platform links (64-bit) (sparc.sun4u) 11.9.0,REV=2001.07.24.15.53 Do you want to remove this package? y ## Removing installed package instance <SUNWctu> ## Verifying package dependencies. ## Processing package information. ## Removing pathnames in class <none> . . . Example 20-20 Removing a Spooled Software PackageThis example shows how to remove a spooled package. # pkgrm -s /export/pkg SUNWaudh The following package is currently spooled: SUNWaudh Audio Header Files (sparc) 11.10.0,REV=2003.08.08.00.03 Do you want to remove this package? y Removing spooled package instance <SUNWaudh> |
||
|