System Administration Guide, Volume I

Adding Packages in a Heterogeneous Client/Server Environment

For the purposes of this discussion, a heterogeneous client/server environment means the clients and servers are either running different versions of the Solaris operating environment or are different hardware platforms (for example, a Solaris 2.3 server of Solaris 7 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 17-3.

Table 17-3 Installing Packages in a Heterogeneous Environment

If the Package's Files Are Installed in The ... 

Then ... 

root (/) file system

Add the package using the procedure in "How to Add a Package to a Diskless or AutoClient System's root (/) File System".

/usr

Add the package using the procedure in "How to Add Packages to a Server".

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 in the pkgmap file.

  1. Log in to any system.

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

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


    $ pkgparam -d device-name pkgid SUNW_PKGTYPE
    

    -d device-name

    Specifies 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.

    pkgid

    Is the name of a software package. 

    SUNW_PKGTYPE

    Is 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.7
/Product SUNWvolr SUNW_PKGTYPE
root
$ pkgparam -d /cdrom/cdrom0/s0/Solaris_2.7/Product SUNWvolu  SUNW_PKGTYPE
usr

How to Add a Package to a Diskless or AutoClient System's root (/) File System

When you add a package to a diskless or AutoClient system, you don't actually install the package on the client. Instead, you add the package to the client's root file system, which resides on a server. A diskless or AutoClient system'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 17-2 to determine how to install the package. If you are working in a heterogeneous client/server environment, use Table 17-3 to determine how to install the package.


  1. Log in to the server as superuser.

  2. Remove any already installed packages with the same names as the ones you are adding.

    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 "Guidelines for Removing Packages", and for task information, see "How to Remove a Diskless or AutoClient System's Package".

  3. Add a software package to the client system's root (/) file system.


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

    -R rootpath

    Specifies the path name of the client's root file system. 

    -d device-name

    Specifies 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, the pkgadd command 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 installs 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.


  4. Verify the package has been installed by logging in to the server as superuser 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.

  5. Verify that the package has been installed successfully using 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.

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


Note -

The name of this release is Solaris 7 but code and path or package path names may use Solaris 2.7 or SunOS 5.7. Always follow the code or path as it is written.


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.7 Solaris CD (/cdrom/cdrom0/s0/Solaris_2.7/Product). 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.7/Product 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

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.

How to Add Packages to a Server

  1. Log in to the server as superuser.

  2. Make sure the server has the OS services necessary for its diskless and AutoClient systems.

    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, Managing Server and Client Support (Tasks).

  3. Determine your next step based on whether the server and the diskless or AutoClient systems are the same Solaris release and the same hardware platform.

    If the Diskless or AutoClient Systems and Server Are ... 

    Then ... 

    The same Solaris release and the same hardware architecture 

    Do not use this procedure. Instead, use the procedure "How to Add Packages to a Standalone System".

     

    Either different Solaris releases or different hardware platforms (for example, a Solaris 2.5 server of Solaris 7 diskless clients, or an x86 server of SPARC diskless clients) 

    Go to Step 4.

  4. Make a copy of the default administration file.


    # cp /var/sadm/install/admin/default
    /var/sadm/install/admin/admin-file
    
  5. 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.7_platform.all/usr

    Solaris_2.7

    Is the Solaris version number: for example, Solaris_2.7

    platform

    Is the hardware architecture of the client: for example, i386or sparc, as in Solaris_2.7_i386.all or Solaris_2.7_sparc.all.

  6. 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 ... 

    -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-name

    Specifies 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 installs all available packages.

    If the pkgadd command 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.

  7. Verify that the package has been installed, using the pkginfo command.


    # 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.

  8. Verify that the package has been installed successfully, using 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.

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