System Administration Guide, Volume I
검색에만이 책은
PDF로 이 문서 다운로드

Adding and Removing Packages

18

This chapter describes how to install, remove, and administer software packages with Solaris commands. You can also use the Admintool(TM) software management capability to install or remove software packages.
This is a list of step-by-step instructions in this chapter.
How to Add Packages to a Standalone Systempage 297
How to Add a Package to a Spool Directorypage 300
How to Add a Package to a Diskless Client's Root File Systempage 305
How to Add a Package to a Dataless Client's Root File Systempage 310
How to Add Packages to a Serverpage 313
How to Determine Where a Package's Files Will Be Installedpage 317
How to Check the Integrity of an Installed Packagepage 319
How to List Information About All Installed Packagespage 321
How to Display Detailed Information About a Packagepage 322
How to Remove a Packagepage 324
How to Remove a Spooled Packagepage 324
How to Remove a Diskless Client's Packagepage 325
How to Remove a Dataless Client's Packagepage 326
How to Start Admintoolpage 329
How to Add Software With Admintoolpage 329

Commands for Handling Software Packages

Table 18-1 shows commands to use for adding, removing, and checking the installation of software packages.
Table 18-1
CommandDescription
pkgadd(1M)Install a software package.
pkgrm(1M)Remove a software package.
pkgchk(1M)Check the installation of a software package.
pkginfo(1M)List software packages installed on a system.
pkgparam(1)List software packages installed on a system.

Prerequisites

All software package installation assumes that there are software packages available on some media. Typically, packages reside on a CD image, tape, diskette, or a hard disk.
A software package is a directory of files that include a pkgmap and a pkginfo file. If these files exist in the specified software package directory, pkgadd or Admintool, whichever you are using to install packages, will attempt to install that package.
In general, before adding new packages, remove any already installed packages with the same name. This ensures that the system keeps a proper record of software that has been added and removed. There may be times when you want to maintain multiple versions of the same application on the system. For strategies on how to do this, see the information in "Guidelines for Removing Packages" on page 291.
If you are installing a package on diskless or dataless clients, determine where the package's files are actually installed. Most importantly, determine whether the package's files are installed in the root (/) file system or in a file system such as /usr, which resides on the server and is shared with the client. Because diskless and dataless clients rely on a server for some of their file systems, a package may need to be installed on the server as well as the client.

Problem With Adding and Removing Packages

There is a known problem with adding or removing some packages developed before Solaris 2.5. If adding or removing the package fails during user interaction, or if you are prompted for user interaction and your responses are ignored, set the following environment variable:
NONABI_SCRIPTS=TRUE

Avoiding User Interaction When Adding Packages

When you use pkgadd with the -a option, pkgadd consults a special administration file for information about how the installation should proceed. Normally, pkgadd performs several checks and prompts the user for confirmation before actually adding the specified package. You can, however, create an administration file that indicates to pkgadd it should bypass these checks and install the package without user confirmation.
The pkgadd command, by default, looks in the current working directory for an administration file. If pkgadd doesn't find an administration file in the current working directory, pkgadd looks in the /var/sadm/install/admin directory for the specified administration file. The pkgadd command also accepts an absolute path to the administration file.

CAUTION Caution - Use administration files judiciously. You should know where a package's files are installed and how a package's installation scripts run before using an administration file to avoid the checks and prompts pkgadd normally provides.

Figure 18-1 shows an example administration file that will prevent pkgadd from prompting the user for confirmation before installing the package.

  mail=  
  instance=overwrite  
  partial=nocheck  
  runlevel=nocheck  
  idepend=nocheck  
  rdepend=nocheck  
  space=nocheck  
  setuid=nocheck  
  conflict=nocheck  
  action=nocheck  
  basedir=default  

Figure 18-1 Sample Administration File
Besides using administration files to avoid user interaction when adding packages, you can use them in several other ways. For example, you can use an administration file to quit a package installation (without user interaction) if there's an error or to avoid interaction when removing packages with pkgrm.
You can also assign a special installation directory for a package. (It would make sense to do this if you wanted to maintain multiple versions of a package on a system.) To do this, set an alternate base directory in the administration file (using the basedir keyword), which specifies where the package will be installed. For more information, see the admin(4) man page.

Adding Packages

· How to Add Packages to a Standalone System

  1. Make sure you have met the prerequisites listed on page 294.

  2. Log in as root.

  3. Add a software package to the system.


  # pkgadd -a admin-file -d device-name pkgid...  

In this command,
-a admin-file(Optional) Specifies an administration file pkgadd should consult during the installation. (For details about using an administration file, see "Avoiding User Interaction When Adding Packages" on page 295.)
-d device-nameSpecifies the absolute path to the software packages. device-name can be a the path to a device, a directory, or a spool directory. If you do not specify the path where the package resides, pkgadd checks the default spool directory (/var/spool/pkg). If the package is not there, the package installation fails.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be installed. If omitted, pkgadd displays all available packages.
If pkgadd encounters a problem during installation of the package, it displays a message related to the problem, followed by this prompt:

  Do you want to continue with this installation?  

Respond with yes, no, or quit. If more than one package has been specified, type no to stop the installation of the package being installed. pkgadd continues to install the other packages. Type quit to stop the installation.

Verification--Installing Software From Mounted CD

To verify that the package has been installed successfully, use the pkgchk command.

  # pkgchk -v pkgid  

If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the error.

Example--Installing Software From Mounted CD

The following example shows a command to install the SUNWaudio package from a mounted Solaris 2.5 CD. The example also shows use of pkgchk to verify that the packages files were installed properly.

  # pkgadd -d /cdrom/cdrom0/s0/Solaris_2.5 SUNWaudio  
       .  
       .  
       .  
  Installation of <SUNWaudio> complete.  
  # pkgchk -v SUNWaudio  
  /usr  
  /usr/bin  
  /usr/bin/audioconvert  
  /usr/bin/audioplay  
  /usr/bin/audiorecord  
  #  

Example--Installing Software From Remote Package Server

If packages you want to install packages that reside on a remote system, you can manually mount the package directory and install packages on the local system. The following example shows the commands to do this. In this
example, assume the remote system named package-server has software packages in the /latest-packages directory. The mount command mounts the packages locally on /mnt, and the pkgadd command installs the SUNWaudio package.

  # mount -F nfs -o ro package-server:/latest-packages /mnt  
  # pkgadd -d /mnt SUNWaudio  
       .  
       .  
       .  
  Installation of <SUNWaudio> 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 SUNWaudio  
       .  
       .  
       .  
  Installation of <SUNWaudio> was successful.  
  #  

The following example is similar to the previous one, except it uses the -a option and specifies an administration file named noask-pkgadd, which is illustrated in Figure 18-1 on page 296. In this example, assume the noask-pkgadd administration file is in the default location, /var/sadm/install/admin.

  # pkgadd -a noask-pkgadd -d /net/package-server/latest-packages SUNWaudio  
       .  
       .  
       .  
  Installation of <SUNWaudio> was successful.  
  #  

Using a Spool Directory

For 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 using pkgadd. The pkgadd command, by default, looks in the /var/spool/pkg directory for any packages specified on the command line.

· How to Add a Package to a Spool Directory

  1. Make sure you have met the prerequisites listed on page 294.

  2. Log in as root to the server or standalone system.

  3. Add a software package to a spool directory.


  # pkgadd -d device-name -s spooldir pkgid...  

In this command,
-d device-nameSpecifies the absolute path to the software packages. device-name can be a the path to a device, a directory, or a spool directory.
-s spooldirSpecifies the name of the spool directory where the package will be spooled. You must specify a spooldir.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be added to the spool directory. If omitted, pkgadd displays all available packages.

Verification--Adding a Package to a Spool Directory

To verify that the package has been copied successfully to the spool directory, use the pkginfo command.

  $ pkginfo -d spooldir | grep pkgid  

If pkgid is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.

Example--Setting Up a Spool Directory From a Mounted CD

The following example shows a command to copy the SUNWaudio and SUNWabe packages from a mounted SPARC Solaris 2.5 CD to the default spool directory (/var/spool/pkg).

  # pkgadd -d /cdrom/cdrom0/s0/Solaris_2.5 -s /var/spool/pkg SUNWaudio SUNWabe  
  Transferring <SUNWaudio> package instance  
  Transferring <SUNWabe> package instance  
  #  

Example--Setting Up a Spool Directory From a Remote Package Server

If packages you want to install reside on a remote system, you can manually mount the package directory and copy it to a local spool directory. The following example shows the commands to do this. In the following example, assume the remote system named package-server has software packages in the /latest-packages directory. The mount command mounts the package directory locally on /mnt, and the pkgadd command copies the SUNWman 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 SUNWman  
  Transferring <SUNWman> 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 SUNWman  
  Transferring <SUNWman> package instance  
  #  

Example--Installing a Package From the Default Spool Directory

The following example shows a command to install the SUNWman package from the default spool directory. (When no options are used with pkgadd, it searches /var/spool/pkg for the named packages.)

  # pkgadd SUNWman  
       .  
       .  
       .  
  Installation of <SUNWman> was successful.  
  #  

Adding Packages in a Homogeneous Client/Server Environment

For the purposes of this discussion, a homogeneous client/server means the clients and servers are running the same version of Solaris and are the same hardware platform (either all SPARC or all x86 platforms).
This section describes how to install packages that place files in a client's root file system. If you are installing a package for clients, and that package does not place files on the client's root file system, the package can be installed directly on the server and shared. (This assumes that the package is installed to a file system such as /usr on the server.)
Use the pkgadd command with the -R option to specify the location of the client's root file system for the client installation. (There's a common misconception that you can use the -R option to specify an alternate base directory for a package installation. That is not the case. The -R option is
specifically for defining the client's root file system. To specify an alternate base directory, use pkgadd with the -a option and provide an administration file that has the basedir keyword set to the new installation directory.)

Note - Packages installed on the server for diskless or dataless clients are read only to the client and are shared with other clients.

Although there are several ways to install and maintain packages in a client/server environment, this section provides instructions on how to do this from a server. This is a centralized software administration model. Note, however, that you can log in to clients and install software directly on them.

Adding Sun Packages on Clients

In general, when installing Sun packages on clients in a homogeneous environment, follow the guidelines in Table 18-2.
Table 18-2
If the Package's Files Are Installed in The ...Then ...
root (/) file systemAdd the package by using one of the following procedures, whichever is appropriate: · "How to Add a Package to a Diskless Client's Root File System" on page 305 · "How to Add a Package to a Dataless Client's Root File System" on page 310.
/usrAdd the package using the procedure "How to Add Packages to a Standalone System" on page 297.
You can determine where a Sun package's files are installed by using the procedure "How to Determine Where a Package's Files Will Be Installed" on page 317.

Adding Third-Party Packages on Clients

When installing third-party packages on clients, follow these guidelines:
  1. Install the package on the server using the procedure "How to Add Packages to a Standalone System" on page 297.

  2. Install the package on the client using the procedure "How to Add a Package to a Diskless Client's Root File System" on page 305 or "How to Add a Package to a Dataless Client's Root File System" on page 310, whichever is appropriate.

Adding Packages in a Heterogeneous Client/Server Environment

For the purposes of this discussion, a a heterogeneous client/server environment means the clients and servers are either running different versions of Solaris or are different hardware platforms (for example, a Solaris 2.3 server of Solaris 2.5 clients, or an x86 server with SPARC clients). Adding packages in a heterogeneous client/server environment presents its own difficulties. The server will have multiple /usr file systems for the heterogeneous clients it supports. For example, it might have an x86 /usr file system for its x86 clients, a Solaris 2.4 /usr file system for its Solaris 2.4 clients, and so on. In general, when installing packages in a heterogeneous client/server environment, follow the guidelines in Table 18-3.
Table 18-3
If the Package's Files Are Installed in The ...Then ...
root (/) file systemAdd the package by using one of the following procedures, whichever is appropriate: · "How to Add a Package to a Diskless Client's Root File System" on page 305 · "How to Add a Package to a Dataless Client's Root File System" on page 310.
/usrAdd the package using the procedure "How to
Add Packages to a Server" on page 313.

· How to Add a Package to a Diskless Client's Root File System

When you add a package to a diskless client, you don't actually install the package on the client, because it doesn't have any local secondary storage device. Instead, you add the package to the client's root file system, which resides on a server. A diskless client's root file system is typically in /export/root/hostname on the server.

Note - If the package's files are installed into the /usr file system, you need to install the package on the server. If you are working in a homogeneous client/server environment, use Table 18-2 to determine how to install the package. If you are working in a heterogeneous client/server environment, use Table 18-3 to determine how to install the package.

  1. Make sure you have met the prerequisites listed on page 294.

  2. Log in to the server as root.

  3. Add a software package to the diskless client's root file system.


  server# pkgadd -R rootpath -d device-name pkgid...  

In this command,
-R rootpathSpecifies the path name of the client's root file system.
-d device-nameSpecifies the absolute path to the software packages. device-name can be a the path to a device, a directory, or a spool directory. If you do not specify the path where the package resides, pkgadd checks the default spool directory (/var/spool/pkg). If the package is not there, the package installation fails.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be installed. If omitted, pkgadd displays all available packages.

CAUTION Caution - During the installation, you may see the following message:
WARNING: filename <not present on Read Only file system>

This indicates that not all of the package's files have been installed. The client may not have access to all files necessary for the software to work correctly. If you see this warning message, you must also install the package on the server as well as the client's root file system.

Verification--Installing a Package From a Mounted CD to a Diskless Client's Root File System

To verify that the package has successfully been installed, log in to the server, become root, and use the pkgchk command.

  server# pkgchk -R rootpath -v pkgid  

If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the error.
You can also verify the package has been installed by logging in as root and using the pkginfo command.

  server# pkginfo -R rootpath | egrep pkgid  

The pkginfo command returns a line of information about the installed pkgid. If pkgid is not installed, pkginfo returns the system prompt.

Example--Installing a Package From a Mounted CD to a Diskless Client's Root File System

The following example shows a command to install the SUNWadmr (software to support system and network administration) package from a server onto a diskless client's root file system. In this case, the diskless client's root file system is /export/root/client-1. This example assumes the SUNWadmr
package is available from a mounted SPARC 2.5 Solaris CD (/cdrom/cdrom0/s0/Solaris_2.5). The example also shows use of pkginfo and pkgchk to verify that the package's files were installed properly.

  server# pkgadd -R /export/root/client-1 -d /cdrom/cdrom0/s0/Solaris_2.5 SUNWadmr  
                .  
                .  
                .  
  Installation of <SUNWadmr> complete.  
  server# pkginfo -R /export/root/client-1 | egrep SUNWadmr  
  system       SUNWadmr     System & Network Administration Root  
  server# pkgchk -v -R /export/root/client-1 SUNWadmr  
  /etc  
  /etc/init.d  
  /etc/init.d/autoinstall  
  /etc/init.d/sysid.net  
  /etc/init.d/sysid.sys  
  /etc/rc2.d  
  /etc/rc2.d/S30sysid.net  
  /etc/rc2.d/S71sysid.sys  
  /etc/rc2.d/S72autoinstall  
  /sbin  
  /sbin/bpgetfile  
  server#  

Example--Installing a Package From a Package Server to a Diskless Client's Root File System

The following example shows a command to install the SUNWcg6 package from a server onto a diskless client's root file system. In this case, the diskless client's root file system is /export/root/client-2. This example assumes the SUNWcg6 package is available from a package server on the network (/net/package-server/latest-packages).

  server# pkgadd -R /export/root/client-2 -d /net/package-server/latest-packages SUNWcg6  
           .  
           .  
           .  
  Installation of <SUNWcg6> complete.  
  server#  

· How to Add a Package to a Dataless Client's Root File System

Dataless clients have their own disk storage devices, but do not have the /usr file system installed locally. Instead, a dataless client mounts the /usr file system from a server. Since part of the dataless client's file system is local and part is mounted from a remote system, adding software packages to dataless clients requires that you know where (in what file systems) a software package is supposed to be installed.

Note - If the package's files are installed into the /usr file system, you need to install the package on the server. If you are working in a homogeneous client/server environment, use Table 18-2 on page 303 to determine how to install the package. If you are working in a heterogeneous environment, use Table 18-3 on page 305 to determine how to install the package.

  1. Make sure you have met the prerequisites listed on page 294.

  2. Log in to the client as root.

  3. Use the share command so that the dataless client's root file system can be remotely mounted by the server.


  client# share -F nfs -o rw,anon=0 /  

  1. Log in to the server as root.

  2. Use the mount command to mount the client's root file system (/) on the server's /mnt directory.


  server# mount -F nfs client-name:/ /mnt  

In this command,
client-name......Is the name of the dataless client.
  1. Use the pkgadd command to add a software package to the system.


  server# pkgadd -R /mnt -d device-name pkgid...  

In this command,
-R /mntSpecifies the mount point of the client's root file system.
-d device-nameSpecifies the absolute path to the software packages. device-name can be the path to a device, a directory, or a spool directory. If you do not specify the path where the package resides, pkgadd checks the default spool directory (/var/spool/pkg). If the package is not there, the package installation fails.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be installed. If omitted, pkgadd displays all available packages.

CAUTION Caution - During the installation, you may see the following message:
WARNING: filename <not present on Read Only file system>

This indicates that not all of the package's files have been installed. The client may not have access to all files necessary for the software to work correctly. If you see this warning message, you must also install the package on the server as well as the client's root file system.

Verification--Adding a Package to a Dataless Client's Root File System

To verify that the package has been installed successfully on the dataless client, use the pkgchk or pkginfo commands on either the server or the dataless client. In these verification examples, the pkgchk and pkginfo commands are issued from the server.

  server# pkgchk -v -R /mnt pkgid  

If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the error.
You can also verify the package has been installed by logging in as root and using the pkginfo command.

  server# pkginfo -R /mnt | egrep pkgid  

The pkginfo command returns a line of information about the installed pkgid. If pkgid is not installed, pkginfo returns the system prompt.

Example--Adding a Package to a Dataless Client's Root File System

The following example shows the commands to add a package to a dataless client's root file system. The share command is executed on the dataless client so the rest of the package installation can be accomplished from the server. This example also shows use of the pkgchk command to verify the package was installed successfully.

  client# share -F nfs -o rw,anon=0 /  
  
  server# mount -F nfs client:/ /mnt  
  server# pkgadd -R /mnt -d /cdrom/cdrom0/s0/Solaris_2.5 SUNWvolr  
       .  
       .  
       .  
  Installation of <SUNWvolr> was successful.  
  server# pkgchk -v -R /mnt SUNWvolr  
  /etc  
  /etc/init.d  
  /etc/init.d/volmgt  
  /etc/rc2.d  
  /etc/rc2.d/K92volmgt  
  /etc/rc2.d/S92volmgt  
  /etc/rmmount.conf  
  /etc/vold.conf  
  server# pkginfo | egrep SUNWvolr  
  system      SUNWvolr       Volume Management, (Root)  
  server#  

· How to Add Packages to a Server

  1. Log in to the server as root.

  2. Make sure the server has the OS services necessary for its diskless and dataless clients.

    Use Host Manager to verify the OS services available on the server. If you need to add OS services, you can do that using the "Add Services" capability of Host Manager. For detailed information, see Chapter 4, "Adding and Maintaining Server and Client Support.

  1. Determine your next step based on whether the server and the diskless or dataless clients are the same Solaris release and the same hardware platform.

If the Diskless or Dataless Clients and Server Are ...Then ...
The same Solaris release and the same hardware architectureDo not use this procedure. Instead, use the procedure "How to Add Packages to a Standalone System" on page 297.
Either different Solaris releases or different hardware platforms (for example, a Solaris 2.3 server of Solaris 2.5 diskless clients, or an x86 server of SPARC diskless clients)Go to Step 4.
  1. Make a copy of the default administration file.


  # cp /var/sadm/install/admin/default /var/sadm/install/admin/admin-file  

  1. Edit the new administration file and set the basedir keyword.

    Use a text editor to edit the new administration file and set the basedir keyword to the correct path for the OS services supporting the client.


  basedir=/export/exec/Solaris_2.x_platform.all/usr  

In this line,
Solaris_2.xIs the Solaris version number: for example,
Solaris_2.5
platformIs the hardware architecture of the client: for example, i386 or sparc, as in
Solaris_2.5_i386.all or
Solaris_2.5_sparc.all.

  1. Add a software package to the server.

    The administration file will specify to install the package into the /usr file system appropriate for the client.


  # pkgadd -a admin-file -d device-name pkgid...  

In this command,
-a admin-file....(Optional) Specifies an administration file pkgadd should consult during the installation. By default, pkgadd looks in the /var/sadm/install/admin directory for the specified administration file. You can also specify an absolute path to an administration file.
-d device-nameSpecifies the absolute path to the software packages. device-name can be the path to a device, a directory, or a spool directory. If you do not specify the path where the package resides, pkgadd checks the default spool directory (/var/spool/pkg). If the package is not there, the package installation fails.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be installed. If omitted, pkgadd displays all available packages.
If pkgadd encounters a problem during installation of the package, it displays a message related to the problem, followed by this prompt:

  Do you want to continue with this installation?  

Respond with yes, no, or quit. If more than one package has been specified, type no to stop the installation of the package being installed. pkgadd continues to install the other packages. Type quit to stop the installation.

Verification--Adding Packages to a Server

To verify that the package has successfully been installed, use the pkgchk command.

  # pkgchk -v pkgid  

If the pkgchk command determines there are no errors for the specified package instance, it returns a list of installed files. Otherwise, it reports the error.
You can also use the pkginfo command to verify a package installation.

  # pkginfo pkgid*  

The pkginfo command will return all instances of the installed package. Typically, pkgadd installs duplicate versions of an already installed package as pkgid.1, pkgid.2, and so on.

Example--Installing Software From a Mounted CD

The following example shows a command to install a fictitious package SUNWtoolu, which will install files into a /usr file system. Assume that the package resides on a mounted product CD, which is mounted on /cdrom/cdrom0 by default. The pkgadd command uses an administration file named new-basedir, which specifies a new installation directory for the package. The example also shows use of pkgchk to verify that the package's files were installed properly.

  # pkgadd -a new-basedir /cdrom/cdrom0 SUNWtoolu  
       .  
       .  
       .  
  Installation of <SUNWtoolu> complete.  
  # pkgchk -v SUNWtoolu  
  /usr  
  /usr/bin  
  /usr/bin/toolconvert  
  /usr/bin/toolplay  
  /usr/bin/toolrecord  
  #  

· How to Determine Where a Package's Files Will Be Installed

This procedure is valid only for Sun software packages. For third-party software products, the surest way to determine where the package's files will be installed is to look in the package's directory at the pkgmap file.
  1. Log in to any system.

    You must be able to access the directory where the packages reside.

  1. Determine where a Sun package's files will be installed.


  $ pkgparam -d device-name pkgid SUNW_PKGTYPE  

In this command,
-d device-nameSpecifies the absolute path to the software packages. device-name can be the path to a device, a directory, or a spool directory. If you do not use the -d option, the pkgparam command will return the default installation directory of the specified pkgid installed on the local system.
pkgidIs the name of a software package.
SUNW_PKGTYPEIs a special parameter that reports where a Solaris software package will be installed. If the package does not have the SUNW_PKGTYPE parameter set, the pkgparam command returns an empty string. For Sun packages, this usually means the package will be installed in /opt.

Example--Determining Where a Package's Files Will Be Installed


  $ pkgparam -d /cdrom/cdrom0/s0/Solaris_2.4 SUNWvolr SUNW_PKGTYPE  
  root  
  $ pkgparam -d /cdrom/cdrom0/s0/Solaris_2.4 SUNWvolu SUNW_PKGTYPE  
  usr  

Checking the Installation of Packages

You use the pkgchk command to check installation completeness, path name, file contents, and file attributes of a package. See the pkgchk(1M) man page for more information on all the options.
Use the pkginfo command to display information about the packages that are installed on the system.

· How to Check the Integrity of an Installed Package

  1. Log in to a system as root.

  2. Check the status of an installed package with the pkgchk command.


  # pkgchk -a | -c -v pkgid ...  
  # pkgchk -d spooldir pkgid ...  

In this command,
-aSpecifies to audit only the file attributes (that is, the permissions), rather than the file attributes and contents, which is the default for pkgchk.
-cSpecifies to audit only the file contents, rather than the file contents and attributes, which is the default for pkgchk.
-vSpecifies verbose mode, which displays file names as pkgchk processes them.
-d spooldirSpecifies the absolute path of the spool directory.
pkgid(Optional) Is the name of one or more packages (separated by spaces). If you do not specify a pkgid, pkgchk checks all the software packages installed on the system. If omitted, pkgchk displays all available packages.

Example--Checking the Contents of an Installed Package

The following example shows how to check the contents of a package.

  # pkgchk -c SUNWadmfw  

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking the File Attributes of an Installed Package

The following example shows how to check the file attributes of a package.

  # pkgchk -a SUNWadmfw  

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking Packages Installed in a Spool Directory

The following example shows how to check a software package 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>  


Note - The checks made on a spooled package are limited because not all information can be audited until a package is installed.

· How to List Information About All Installed Packages

List information about installed packages with the pkginfo command.

  $ pkginfo  

Example--Listing All Packages Installed

The following example shows the pkginfo command to list all packages installed on a local system, whether that system is a standalone, server, diskless client, or dataless client. The output shows the primary category, package name, and a description of the package.

  $ pkginfo  
  applicationSUNWabe        Solaris 2.4 User AnswerBook  
  system       SUNWaccr     System Accounting, (Root)  
  system       SUNWaccu     System Accounting, (Usr)  
  system       SUNWadmap    System & Network Administration Applications  
  system       SUNWadmfw    System & Network Administration Framework  
       .  
       .  
       .  

Example--Listing All Packages Installed on a Diskless Client

In a diskless client/server setup, you may want to manage software from a central location. Since the server is the place to do this, you would need to use a variation of the pkginfo command. The following example shows the pkginfo -R command to list all packages installed on a diskless client named io. This command is executed from the diskless client's server.

  server$ pkginfo -R /export/root/io  
  system       SUNWaccr     System Accounting, (Root)  
  system       SUNWaccu     System Accounting, (Usr)  
  system       SUNWadmap    System & Network Administration Applications  
  system       SUNWadmfw    System & Network Administration Framework  
       .  
       .  
       .  

Example--Listing All Packages Installed on a Dataless Client

Similarly, in a dataless client/server setup, you may want to monitor software packages installed on the client, but do it from the server. The following example shows the mount and pkginfo commands to list all packages installed on a dataless client. (This assumes that the dataless client named andromeda shares its root file system; otherwise, the mount will fail.) This command is executed from the dataless client's OS server.

  server# mount -F nfs andromeda:/ /mnt  
  server# pkginfo -R /mnt  
  system       SUNWadmr     System and Network Administration, (Root)  
  system       SUNWcar      Core Architecture, (Root)  
  system       SUNWcsd      Core Solaris Devices, (Root)  
  system       SUNWcsr      Core Solaris, (Root)  
       .  
       .  
       .  

· How to Display Detailed Information About a Package

List information about installed packages with the pkginfo -l command.

  $ pkginfo -l pkgid ...  

In this command,
-lSpecifies to display output in long format, which includes all available information about the package.
pkgid(Optional) Is the name of one or more packages (separated by spaces). If omitted, pkginfo displays information about all available packages.

Example--Displaying Detailed Information About a Package


  $ pkginfo -l SUNWcar  
  PKGINST:         SUNWcar  
  NAME:            Core Architecture, (Root)  
  CATEGORY:        system  
  ARCH:            sparc.sun4c  
  VERSION:         10.0.2  
  BASEDIR:         /a  
  VENDOR:          Sun Microsystems, Inc.  
  DESC:            Core Architecture, (Root)  
  PSTAMP:          dive920521215828  
  INSTDATE:        Jun 03 1992  03:16  
  HOTLINE:         Please contact your local service provider  
  STATUS:          completely installed  
  FILES:           39 installed path names  
                    7 shared path names  
                    1 linked files  
                    7 directories  
                    21 executables  
                    3603 blocks used (approx)  

Removing Packages From Servers and Standalone Systems


CAUTION Caution - Always use the pkgrm command to remove installed packages. Do not use the rm(1) command, which will corrupt the system's record-keeping of installed packages.

· How to Remove a Package

  1. Log in to the system as root.

  2. Remove an installed package.


  # pkgrm pkgid...  

In this command,
pkgid........(Optional) Is the name of one or more packages (separated by spaces). If omitted, pkgrm displays all available packages. If omitted, pkgrm displays all available packages.

· How to Remove a Spooled Package

  1. Log in as root.

  2. Remove an installed package from a spool directory with the pkgrm -s command.


  # pkgrm -s spooldir pkgid...  

In this command,
-s spooldir....Specifies the name of the spool directory where the package was spooled.
pkgid........(Optional) Is the name of one or more packages (separated by spaces). If no pkgid is supplied, pkgrm prompts the user to remove each package listed in the spool directory. If omitted, pkgrm displays all available packages.

· How to Remove a Diskless Client's Package

  1. Log in to the server and become root.

  2. Remove a software package from a dataless client's OS server with the

    pkgrm -R command.


  server# pkgrm -R rootpath pkgid...  

In this command,
-R rootpathSpecifies the mount point of the client's root file system.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be removed. If omitted, pkgrm displays all available packages.
Files in the client's package database that are marked shared are not removed from the server, but are removed from the client's database. If all clients have removed the package, you can remove the shared files from the server using a separate invocation of pkgrm on the server.

Verification--Removing a Diskless Client's Package

To verify that the package has successfully been removed, use the pkginfo command.

  server$ pkginfo -R rootpath | egrep pkgid  

If pkgid is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.

Example--Removing a Diskless Client's Package

In the following example, assume the client's root file system is shared. Also, assume these commands are executed on the client's server.

  server# pkgrm -R /export/root/client-1 SUNWaudio  
  The following package is currently installed.  
  SUNWaudio  
  Do you want to remove this package? y/n/q?  
  y  
       .  
       .  
       .  
  server#  

· How to Remove a Dataless Client's Package

  1. Log in to the dataless client and become root.

  2. Share the dataless client's root (/) file system so that it can be remotely mounted by the server.


  client# share -F nfs -o rw,anon=0 /  

  1. Log in to the server as root.

  2. On the server, use the mount command to mount the client's root file system (/) on the server's /mnt directory.


  server# mount -F nfs client-name:/ /mnt  

  1. Use the pkgrm command to remove a software package from the system.


  server# pkgrm -R /mnt pkgid...  

In this command,
-R /mntSpecifies the mount point of the client's root file system.
pkgid(Optional) Is the name of one or more packages (separated by spaces) to be removed. If omitted, pkgrm displays all available packages.
Files in the client's package database that are marked shared are not removed from the server, but are removed from the client's database. If all clients have removed the package, you can remove the shared files from the server using a separate invocation of pkgrm on the server.

Verification--Removing a Dataless Client's Package

To verify that the package has successfully been removed, use the pkginfo command.

  server$ pkginfo -l | grep pkgid  

If pkgid is installed, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.

Example--Removing a Dataless Client's Package

In the following example, assume the client's root file system is shared. Also, assume these commands are executed on the client's server.

  server# mount -F nfs client-1:/ /mnt  
  server# pkgrm -R /mnt SUNWvolr  
  The following package is currently installed.  
  SUNWvolr  
  Do you want to remove this package? y/n/q?  
  y  
       .  
       .  
       .  
  server#  

Managing Software Packages With Admintool

Solaris 2.5 software includes a new version of Admintool, which is a graphical user interface for performing several administration tasks, including adding and removing software packages. Specifically, you can use Admintool to:
  • Add software packages to a local system
  • Remove software packages from a local system
  • View software already installed on the local system
  • Customize software packages to be installed
  • Specify an alternate installation directory for a software package

· How to Start Admintool

  1. Log in as root.

    Unless you are a member of the UNIX sysadmin group (group 14), you must become root on your system to add or remove software packages with Admintool.

  2. Start Admintool.


  # admintool &  

  1. Select Software from the Admintool Browse menu.

Imported image(373x228)

· How to Add Software With Admintool

  1. Start Admintool.

  2. Select Software from the Admintool Browse menu.

  1. Select Add from the Edit menu.

    The Admintool: Set Source Media window may appear. If so, specify the path to the installation media. The default path is a mounted SPARC Solaris CD.

Internal bitmap(360x150)

  1. Select the software you want to install on the local system.

Internal bitmap(504x265)

  1. Click the Add button.

    For each package selected, a window will appear prompting you for information about the installation.