Innerhalb
Nach weiteren Dokumenten suchen
Support-Ressourcen
| Dieses Buch im PDF-Format herunterladen
Adding and Removing Packages
1
- Solaris provides these ways to add and remove packages:
-
- Command-line utilities: pkgadd(1M), pkgrm(1M), and related commands
- Graphical user interface: Software Manager, swmtool(1)
-
Note - For reliable handling of AnswerBook packages, it is recommended that you use the command line utilities,pkgadd(1M) and related commands. For complete instructions on this topic, see Adding and Configuring AnswerBook Packages.
- Use this table to find the instructions you need in this chapter.
-
Using Commands for Handling Software Packages
- You can use the following commands to work with software packages:
-
-
pkgadd(1M) to install a package
-
pkgrm(1M) to remove a package
-
pkgchk(1M) to check the installation of a package
-
pkginfo(1M) to list the packages installed on a system
Installing Packages on a Server or Standalone System
- Some package installations require space in the root file system, and others do not. If you know that a package's files do not need space in the root file system of client systems (for example, AnswerBook installations do not affect the root file system), you can install the package on a server. When the server's file system is mounted by the clients, the software becomes available to them.
-
Note - AnswerBook on-line documentation is an exception to the rule above. To make AnswerBook sets available to users on a network, you have to install the AnswerBook package(s) and then perform an administrative procedure. See Part 2 of this guide, Adding and Configuring AnswerBook Packages--in particular, Chapter 3, "AnswerBook Administration."
- If a package's files do affect the root file system, follow the instructions in "Installing Packages for Clients on a Server" on page 4.
· How to Insert the CD-ROM Disk
- Begin all installations with these steps.
-
-
Place the CD-ROM into a caddy.
-
Insert the caddy into the drive.
If the volume management daemon is enabled (the default), inserting the CD-ROM mounts it automatically. If you have disabled volume management, mount the CD-ROM using the mount(1M) command. File Manager opens, displaying the contents of the CD-ROM.
· How to Install Packages on a Server or Standalone System
-
-
Become superuser.
-
Type /usr/sbin/pkgadd -d device pkgid and press Return. The argument pkgid stands for the name of the package to be installed.
For example:
-
-
# /usr/sbin/pkgadd -d /cdrom/solaris_2_3/s0/Solaris_2.3 SUNWpkgA
- Use a space to separate multiple packages on the command line. For example:
-
-
# /usr/sbin/pkgadd -d /cdrom/solaris_2_3/s0/Solaris_2.3 SUNWpkgA SUNWpkgB SUNWpkgC
- The argument to the -d option must be a full path name to a device or directory. If you do not specify the device on which the package resides, pkgadd checks the default spool directory (/var/spool/pkg). If the package is not there, installation fails.
- 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 either 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 with installation of the other packages. Type quit to stop the installation.
· How to Copy a Package to a Spool Directory
-
-
Become superuser.
-
Type /usr/sbin/pkgadd -d device -s spooldir pkgid and press Return.
- The spooldir argument is the name of the spool directory where the package was spooled. The argument pkgid stands for the name of the package to be copied.
- To install a package that has been copied to a spool directory, specify the spool directory as the argument to the -d option of pkgadd.
Installing Packages for Clients on a Server
- This section describes how to install packages that place files in a client's root file system. If you are installing a package that does not place files on the client's root file system, the package can be installed on the server. See "Installing Packages on a Server or Standalone System" on page 2 for more information.
- Use the pkgadd command with the -R option to specify the location of the dataless or diskless client's root file system for the client installation. After you have installed the package on the client's file systems, you may also need to install files that will be shared by all clients on the server's file systems. To install the package on the server, see "Installing Packages on a Server or Standalone System" on page 2.
-
Note - Packages installed on the server for diskless or dataless clients are read-only to the client and are shared with the server and other clients.
· How to Install a Package in a Diskless Client's Root File System
-
-
Become superuser.
-
Type /usr/sbin/pkgadd -R rootpath -d device_name pkgid and press Return.
The rootpath is the path name of the client's root file system. The argument pkgid stands for the name of the package to be installed. During the installation you may see either of the following messages:
-
-
filename <already present on Read Only file system>
WARNING: filename <not present on Read Only file system>
- Typically this means that the files named in the error messages will be shared by the clients and need to be installed on the server's file systems.
· How to Install a Package for a Dataless Client on a Server
-
-
Become superuser.
-
-
On the client, type share root and press Return.
-
-
The client must export its root file system so it can be remotely mounted by the server.
-
On the server, type mkdir /directory_name and press Return. This directory will be used as a mount point for the client's root file system.
-
On the server, type /etc/mount client_name:/ /directory_name and press Return.
The directory_name argument should be the same directory name specified in Step 2.
-
Type /usr/sbin/pkgadd -R /directory_name -d device_name pkgid and press Return.
During the installation you may see either of the following messages:
-
-
filename <already present on Read Only file system>
WARNING: filename <not present on Read Only file system>
- Typically this means that the files named in the error messages will be shared by the clients and need to be installed on the server's file systems.
Checking the Installation of Packages
- You use the pkgchk command to check installation completeness, path name, file contents, and file attributes of a package. Table 1-1 lists some of the pkgchk options and describes their purpose. See the pkgchk(1M) man page for more information on all the options.
-
Table 1-1 pkgchk
| Option | Purpose |
| -p <pathname> | Checks the accuracy of the specified path name |
| -c | Displays information on the contents of the files in the package |
| -a | Displays information on the attributes of the files in the package |
| -d device | Specifies the device or location of a spooled package |
· How to Check the Installation of an Installed Package
-
* Type /usr/sbin/pkgchk pkgid and press Return.
- You can specify more than one package identifier on the command line. The names are separated by spaces. If you specify no package identifier, the entire contents of the machine are checked.
· How to Check the Installation of a Specific Path Name
-
* Type /usr/sbin/pkgchk -p <pathname> and press Return.
- You can specify multiple path names in a comma-separated list.
· How to Check the File Contents of a Package
-
* Type /usr/sbin/pkgchk -c pkgid and press Return.
· How to Check the File Attributes of a Package
-
* Type /usr/sbin/pkgchk -a pkgid and press Return.
· How to Check the Completeness of a Spooled Package
-
* Type /usr/sbin/pkgchk -d spooldir pkgid and press Return.
-
Note - The checks made of a spooled package are limited because not all information can be audited until a package is installed.
Checking Installed Package Information
- Use the pkginfo command to display information about the packages that are installed on the system.
· How to List Information About All Installed Packages
-
* Type /usr/sbin/pkginfo and press Return. The information displayed will be similar to the following, listing the primary category, package instance, and the names of all completely installed and partially installed packages.
-
-
system SUNWcar Core Architecture, (Root)
graphics SUNWcg12 GS (cg12) Device Driver
· How to Display Detailed Information About a Package
-
* Type /usr/sbin/pkginfo -l pkgid and press Return. The argument pkgid is the identifier, or instance, of the package for which you want the information.
- The information you get will be similar to the following.
-
-
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
- 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
-
* Type /usr/sbin/pkgrm pkgid and press Return. The argument pkgid is the identifier of the package to be removed.
· How to Remove a Spooled Package
-
* Type /usr/sbin/pkgrm -s spooldir [pkgid] and press Return. The spooldir argument is the name of the spool directory where the package was spooled. The pkgid is the name of the package to be removed. If no package identifier is supplied, pkgrm prompts the user to remove each package listed in the spool directory.
· How to Remove a Client's Package
-
-
Type /usr/sbin/pkgrm -R rootpath pkgid and press Return. The specified package is removed from the client's file systems that reside on the server.
-
If shared files were installed on the server's file systems, type
/usr/sbin/pkgrm pkgid and press Return. The shared files for that particular package are removed from the server.
- If the package was installed on file systems that are on the client machine, you can remove the package as follows:
-
-
On the client, type export root and press Return. The client must export its root file system so it can be remotely mounted by the server.
-
On the server, type mkdir /directory_name and press Return. This directory will be used as a mount point for the client's root file system.
-
On the server, type /etc/mount client_name:/ /directory_name and press Return.
The directory_name argument should be the same directory name specified in Step 2.
-
Type /usr/sbin/pkgrm -R /directory_name pkgid and press Return.
- 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.
Problem With Adding and Removing Packages
- There is a known problem with adding or removing some packages developed prior to Solaris 2.4. 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_SCRIPT=TRUE
Software Manager (swmtool): Graphical User Interface for Packages
- You can install software on your local system or a remote system with Software Manager (the swmtool(1M) command).
- Software Manager can be used in two ways:
-
- To look at the software installed on the local system
- To install or remove software on a local or remote system
- The default location for the installation is the local system (shown in the Target Hosts list presented by Software Manager).
-
Note - To add or remove AnswerBook packages, use the command line utilities,pkgadd(1M) and related commands rather than Software Manager. See Part 2, Adding and Configuring AnswerBook Packages.
Basic Procedures Using Software Manager
- To install or remove the software from a local or remote system, run Software Manager as superuser. If you just want to view the software packages that have been installed on a system, you do not need to be superuser.
· How to Start Software Manager as Superuser
-
-
To become superuser, type su and press Return.
-
Type the superuser password at the Password: prompt and press Return.
-
Type /usr/sbin/swmtool & and press Return.
-
Note - Make sure that the system running Software Manager allows programs run by root to be displayed. If root is not authorized to display programs on that system, use the xauth command to set up the proper authorization. See xauth(1) for information.
- When you start the Software Manager, use the -d option to specify the directory where it should look:
-
-
# /usr/sbin/swmtool -d /cdrom/cdrom0
· How to Install a Package on a Local System
-
-
Place the CD-ROM disk into a caddy, then insert the caddy into the CD-ROM drive.
-
Choose Install from the Mode options presented by Software Manager.
-

-
-
Click Props to bring up the Properties window.
-
Choose Source Media from the Category menu to display the Properties window.
-

-
-
Choose Mounted Directory from the Media Type menu.
- .
-

-
-
Type the name of the directory in the Directory Name field and click Apply.
If you are using a CD-ROM, it is automatically mounted by volume management with the default /cdrom/cdrom0 for the mounted directory name. If you have disabled volume management, make sure in this step the path you specify is the full and correct mount point for the CD-ROM.
-
Select the icon associated with the software.
In this step you can see if the software you want to install will fit on the target system. If there is insufficient space available on the target system, the Space Meter window is displayed. Otherwise, the installation continues as described here.
- .
-

- If the software is packaged in clusters, you can view the components of the clusters by double-clicking on the icon representing the software or by choosing Expand from the Software menu.
- To bring up the Software menu, place the cursor over the software icon and press the MENU mouse button.
-

-
-
To choose the software you want to install, select the associated icons.
(The Space Meter window is displayed if there is insufficient space on the target system.)
- .
-

-
Note - Make sure that you have deselected all the software that you do not want to install. A package is selected if the icon is darkened. To deselect a software package, click once on the darkened icon. To deselect all the software packages, choose Deselect All from the Edit menu.
-
-
Click Begin Installation.
- The Software Manager Command window is displayed and you are asked questions to help the Software Manager install the software.
· How to Remove a Package From a Local System
-
-
Choose Remove from the Mode options presented by Software Manager.
-

-
-
Select the packages to remove.
-
Click Begin Removal.
The Software Manager Command window asks you to confirm the removal of the software.
-
-
Type y to continue removing the package.
-

- The complete list of installed software displayed in the Software Manager is updated to reflect the changes you made.
Identifying Remote Systems to the Software Manager
- Before you install or remove software on remote systems, you must provide the name of the remote system to the Software Manager. You need superuser access (root access) to the remote systems you identify. There are two ways to get this access:
-
- Know the superuser password for the remote system.
- Ensure that the remote system has an .rhosts entry allowing unrestricted superuser access to the system on which you are running the Software Manager.
-
Note - Note that allowing unrestricted superuser access on a system reduces the security of that system.
- For both methods of getting superuser access, the CONSOLE entry in /etc/default/login must be commented out. In this version of Solaris, the default value is not commented out; remote root access is not permitted. Refer to "Restricting root Access" in Security, Performance, and Accounting Administration.
- For more information on .rhosts entries, see Security, Performance, and Accounting Administration and the man page rhost(4) in the SunOS Reference Manual.
· How to Add a Remote System to the List of Hosts
- Follow these steps to add a remote system to the list of hosts that the Software Manager keeps.
-
-
Click the Props button on the Software Manager main window.
The Properties window is displayed.
-
Choose Remote Hosts from the Category menu on the Properties window.
The Remote Hosts Properties window is displayed.
- .
-

-
-
To add an entry for a remote system, enter its name in the Host Name field.
Enter the root (superuser) password if necessary.
-
-
To add the remote system to the Target Hosts list, choose Add Entry from the Edit menu.
In this example, the host baltimore was added to the Target Hosts list. Before actually adding it to the list, Software Manager checked to see if the root password for baltimore was valid. The Software Manager then added the host name to the list with a symbol showing a solid triangle pointing upward indicating that the remote host is operational. See Table 1-2 for a description of the Target Hosts symbols and their meaning.
-
Table 1-2
| Target Hosts Symbol | Meaning |




| The host listed is up. Software Manager has the necessary permissions to install or remove software on this host. The host listed is down. The host listed is a known host on the network, but Software Manager does not have the necessary permissions to install or remove software on this host. Or, the host is unknown to the network. The host listed is not a Solaris 2.x system.
|
-
-
When you have finished adding all the remote systems, click Apply.
This registers your changes to the Target Hosts list with Software Manager.
· How to Select a Remote System
- After adding a system to the list of hosts, you must select it before installing or removing software on it.
-
-
To determine if a system is selected, look at the right column in the Target Hosts list--it will say either SELECTED or UNSELECTED.
-
-
If the system you want is UNSELECTED, click the entry in the Target Hosts list and click Toggle Selection.
-

- The right column of the entry changes to show that host is SELECTED.
-
-
Be sure to deselect any systems on which you do not want to install or remove software.
-
To inform the Software Manager of your changes to the Target Hosts list, click Apply.
-
Install the software as you would for a local system.
The software is installed on the hosts you selected in the Target Hosts list.
· How to Set Up Access to a Remote CD-ROM Drive
- If you want to set up access to files on a remote CD-ROM drive, follow these steps.
- On the remote system with the CD-ROM drive:
-
-
Become superuser.
-
Insert the CD-ROM.
Volume management mounts it, and its files are accessible to the network.
-
Edit the /etc/dfs/dfstab file, adding the following line to the end of the file.
-
share -F nfs -o ro,anon=0 cdrom/cdrom0/s0
|
-
Note - For further reference, see the share(1M) man page.
-
-
Type the shareall(1M) command.
-
· How to Access Shared CD-ROM Files
- On a system from which you want to access the remote CD-ROM drive:
-
-
Become superuser.
-
Change to the CD-ROM directory.
If you are running automounter, change to the remote system's cdrom/cdrom0 directory.
-
% cd /net/system_with_CDROM/cdrom/cdrom0/s0
|
-
Note - The path name shown here is the mount point if volume management is enabled (the default with Solaris). If you have disabled volume management, make sure in this step that the path you specify is the correct mount point for the CD-ROM.
-
-
If you are not running automounter, mount the directory:
-
# mount -F nfs -o ro system_with_CDROM:cdrom/cdrom/s0 /cdrom
|
- The files from the remote system's directory /cdrom/cdrom0/s0 are mounted on the system_with_CDROM.
Using Software Manager to Add Support for Clients
- The Software Manager allows you to add software support for clients that have a different architecture or use a different operating system version than the server. Adding software support installs the portions of the operating system that are specific to the architecture or version of the operating system.
- If you add diskless or dataless clients that have an architecture or operating system version different from the server, you must add software support before using Host Manager to set up the clients. For more information on Host Manager, see:
-
· How to Add Software Support for Diskless or Dataless Clients
-
-
Choose Add Client Support from the Software Manager Edit menu.
- The Add Client Support window is displayed.
-

-
-
Select the OS (operating system) Version for the clients.
-
Select the machine architectures for the clients you want to support and click Apply.
-
Note - Any client support software installed must contain the software for the local machine's native architecture. If, for example, the local machine is a Sun4c, then client support software must contain support for the Sun4c architecture. The native environment for the server is its operating system and architecture. If the server is a Sun4c machine running SunOS 5.3, its native environment is its operating system (SunOS 5.3) and its architecture (Sun4c).
-
-
Click Begin Installation.
|
|