This chapter provides procedures for performing tasks associated with extending and updating the deployed Sun GlassFishTMEnterprise Server v3 by using Update Tool. Procedures for using the pkg command are contained in this chapter. A set of reference pages that contain details on using the pkg command is included with Enterprise Server.
The following topics are addressed here:
Instructions for accomplishing the tasks in this chapter by using the Administration Console are contained in the Administration Console online help for Update Tool. The standalone Update Tool also contains online help. For additional information about Update Tool, see http://wikis.sun.com/display/IpsBestPractices/Screenshots
Enterprise Server is designed to provide its functionality in a modular form so that you can choose to include the functionality that you need and leave out the functionality that is not needed. OSGi modules, also called bundles, provide add-on functionality for your deployed Enterprise Server. You can add or remove an add-on component during runtime, with no need to restart the server.
Over time, new add-on components will be developed and existing components will be modified. Enterprise Server provides a set of image packaging system (IPS) tools for updating software on a deployed server. You can install new or updated add-on components by using the Update Tool in the following ways:
As a selection in the graphical Enterprise Server Administration Console
As a standalone graphical tool which can be started from the command line using the following format: as-install-parent/bin/updatetool
As a command-line utility (the pkg command) which can perform most of the tasks offered by the graphical Update Tool. The main reasons for using the pkg command are:
Extensive online help is provided for both graphical versions.
This section provides instructions for using the pkg command to install Enterprise Server add-on components on your deployed Enterprise Server.
The pkg command enables you to install an add-on component on your system. If multiple versions of a package are available, the latest one is applied unless you specify otherwise. The pkg command, located in the as-install-parent/bin directory,
If the pkg component, the updatetool component, or any other valid component that you try to invoke from the command line is not yet installed on your deployed Enterprise Server, you will receive a query asking if you want to install the component. Answer Y to install the component.
Enterprise Server v3 must be fully deployed before you can install additional components. If you need installation instructions, see Sun GlassFish Enterprise Server v3 Installation Guide.
List your installed components:
pkg list |
Information similar to the following is displayed:
NAME (AUTHORITY) VERSION STATE UFIX glassfishv3-common 0-1 installed ---- glassfishv3-ejb 0-1 installed u--- glassfishv3-nucleus 0-1 installed ---- glassfishv3-web 0-1 installed ---- grails 1.0-1.0 installed ---- jersey 0.7-0.1 installed u--- jmaki 1.8.0-1.0 installed ---- jruby 1.1.1-1.0 installed ---- metro 1.2-1 installed u--- pkg 0.1.4-6.564 installed u--- python2.4-minimal 2.4.4-6.564 installed u--- updatetool (glassfish.org) 2.0-6.564 installed u--- wxpython2.8-minimal 2.8.7.1-6.564 installed u---
List all packages that are available:
pkg list -a |
Information similar to the following is displayed from the repository:
NAME (AUTHORITY) VERSION STATE UFIX glassfishv3-common 0-1 known u--- glassfishv3-common 0-1 known u--- glassfishv3-common 0-1 installed ---- glassfishv3-ejb 0-1 known u--- glassfishv3-ejb 0-1 known u--- glassfishv3-ejb 0-1 known u--- glassfishv3-ejb 0-1 installed u--- glassfishv3-ejb 0-1 known ---- glassfishv3-nucleus 0-1 known u--- glassfishv3-nucleus 0-1 known u--- glassfishv3-nucleus 0-1 installed ---- glassfishv3-web 0-1 known u--- glassfishv3-web 0-1 known u--- glassfishv3-web 0-1 installed ---- grails 1.0-1.0 installed ---- javadb 0-1 known u--- javadb 0-1 known u--- javadb 0-1 known ---- jersey 0.7-0.1 installed u--- jersey 0.7-0.2 known u--- jersey 0.7-0.3 known u--- jersey 0.8-0.1 known ---- jmaki 1.8.0-1.0 installed ---- jruby 1.1.1-1.0 installed ---- metro 1.2-1 installed u--- metro 1.2-2 known u--- metro 1.2-3 known ---- pkg 0.1.4-6.564 installed u--- pkg 0.1.5-8.724 known ---- python2.4-minimal 2.4.4-6.564 installed u--- python2.4-minimal 2.4.4-8.724 known ---- updatetool 2.0-6.564 installed u--- updatetool 2.0-8.724 known ---- wxpython2.8-minimal 2.8.7.1-6.564 installed u--- wxpython2.8-minimal 2.8.7.1-8.724 known ----
Navigate to the as-install directory.
Install a package from the available packages list.
Use the following syntax: pkg install package-name. For example:
pkg install javadb |
The most recent version of the component is installed and information similar to the following is displayed:
DOWNLOAD PKGS FILES XFER (MB) javadb 0/1 61/200 2.10/7.26 PHASE ACTIONS Install Phase 222/222
To apply your changes, restart Enterprise Server.
See To Restart a Domain.
Full syntax and options for using the pkg command are described in the pages in the as-install/pkg/man/ directory. These reference pages are not displayed by using the man command. Instead, use a command such as more or cat.
This section provides the following instructions for updating Enterprise Server components after they have been installed:
When you install an updated version of a component, only those files that have been modified are downloaded and installed. Files that have been removed in the updated package are removed during the update process.
Obtain a list of only the installed packages that have available updates:
pkg list -u |
Information similar to the following is displayed:
NAME (AUTHORITY) VERSION STATE UFIX glassfishv3-ejb 0-1 installed u--- jersey 0.7-0.1 installed u--- metro 1.2-1 installed u--- pkg 0.1.4-6.564 installed u--- python2.4-minimal 2.4.4-6.564 installed u--- updatetool (glassfish.org) 2.0-6.564 installed u--- wxpython2.8-minimal 2.8.7.1-6.564 installed u---
Install a new version of a package.
Use the following syntax: pkg install package-name. For example:
pkg install metro |
Information similar to the following is displayed:
DOWNLOAD PKGS FILES XFER (MB) Completed 1/1 5/5 0.49/0.49 PHASE ACTIONS Removal Phase 2/2 Update Phase 7/7 Install Phase 2/2
To apply your changes, restart Enterprise Server.
See To Restart a Domain.
Full syntax and options for using the pkg command are described in the pages in the as-install /pkg/man/ directory. These reference pages are not displayed by using the man command. Instead, use a command such as more or cat.
Enterprise Server enables you to maintain multiple installation images on a single system. When you update an installation image, all the components that are present in that image are updated to new versions, if new versions are available. When you install updated versions of components, only those files that have been modified are downloaded and installed. Files that have been removed in the updated package are removed during the update process.
Install all packages for the image.
Use the following syntax: pkg install image-name. For example:
pkg image-update |
Information similar to the following is displayed:
DOWNLOAD PKGS FILES XFER (MB) Completed 6/6 729/729 21.59/21.59 PHASE ACTIONS Removal Phase 887/887 Update Phase 253/253 Install Phase 584/584
To apply your changes, restart Enterprise Server.
See To Restart a Domain.
Full syntax and options for using the pkg command are described in the pages in the as-install /pkg/man/ directory. These reference pages are not displayed by using the man command. Instead, use a command such as more or cat.
If you are discontinuing use of a component and want to remove it from your system, you can do this by using the uninstall command. If you need to revert to a prior version of a component, you will need to uninstall the current version and install the prior version by specifying the version number.
Verify that there are no dependencies on the installed component before removing it.
Obtain a list of all your installed components:
pkg list |
NAME (AUTHORITY) VERSION STATE UFIX glassfishv3-common 0-1 installed ---- glassfishv3-ejb 0-1 installed u--- glassfishv3-nucleus 0-1 installed ---- glassfishv3-web 0-1 installed ---- grails 1.0-1.0 installed ---- jersey 0.7-0.1 installed u--- jmaki 1.8.0-1.0 installed ---- jruby 1.1.1-1.0 installed ---- metro 1.2-1 installed u--- pkg 0.1.4-6.564 installed u--- python2.4-minimal 2.4.4-6.564 installed u--- updatetool (glassfish.org) 2.0-6.564 installed u--- wxpython2.8-minimal 2.8.7.1-6.564 installed u---
Uninstall the component that you want removed from your system.
Use the following syntax: pkg uninstall package-name. For example:
pkg uninstall jruby |
To apply your changes, restart Enterprise Server.
See To Restart a Domain.
Full syntax and options for using the pkg command are described in the pages in the as-install /pkg/man/ directory. These reference pages are not displayed by using the man command. Instead, use a command such as more or cat.
If there is a malfunction in an installed component, you might want to revert to an older version of that component. The way to restore an older version of a component is to first uninstall the current version of the component, then install the specific older version that you want to reinstate.
Be sure to verify that the older version of the component is in the repository before you uninstall your current version.
Verify that the older version of the component is still available:
pkg list -a |
Obtain a list of your installed components:
pkg list |
Uninstall the currently-installed component that you want to replace.
Use the following syntax: pkg uninstall package-name. For example:
pkg uninstall jersey |
Install the older version of the component.
Use the following syntax: pkg install package-name —version version-number. For example:
pkg install jersey -version 0.7-0.2 |
Verify that the older version is installed:
pkg list |
Full syntax and options for using the pkg command are contained in the pages in the as-install /pkg/man/ directory. These reference pages are not displayed by using the man command. Instead, use a command such as more or cat.