| UNIX at Fermilab main page | Computing Division | Fermilab at Work | Fermilab Home | ||||
![]() |
Fermilab Computing Division UNIX at Fermilab, Pre-Release 4.0 |
|||
Chapter 9: Accessing Software Products
At Fermilab, software products for the supported UNIX operating systems are maintained and distributed using UPS (UNIX Product Support) and UPD (UNIX Product Distribution). These utilities are fully described in the document Complete Guide and Reference Manual for UPS, UPD and UPP v4, on the Web at http://www.fnal.gov/docs/products/ups/ and in print.1
This chapter provides a brief introduction to UPS and UPD , and enough information to list and access products on a user node, and to install products from a UPS/UPD distribution node onto a system with an uncomplicated UPS/UPD configuration. For further information, we point the reader to the UPS/UPD document referenced above.
Do you just need to know how to access a product? Skip straight to section 9.2.4 Setting up a Product.
9.2 UPS Operations for the End User
9.2.1 Determining your Machine's Flavor
9.2.2 Listing Product Information in a UPS Database
9.2.3 Finding a Product's Dependencies
9.2.5 Running Unsetup on a Product
9.3.1 User Node Registration for KITS Database
9.3.2 upd install Command Functions
9.3.3 upd install Command Syntax
9.1 Introduction to UPS and UPD
UPS is a software support toolkit developed at Fermilab for the management of software products on local systems by the system administrators and users. It was also designed to facilitate the product distribution and configuration management tasks of the product providers. The three principal user benefits are:
- a uniform interface for accessing all products on a UNIX (or UNIX-like, e.g., Cygwin) system via the setup command
- unified and coordinated support of in-house and vendor-supplied software across all the supported UNIX operating systems
- the capacity for running multiple concurrent versions of products on the same system, with a standard, simple version-selection mechanism
UPD is a companion product to UPS , and provides the functionality for uploading/downloading products between user and development systems and product distribution servers.
Elements of a UPS/UPD installation include:
- one or more databases; a UPS database is a directory which functions as a central repository of information about products and contains pointers to products.
- a UPS database configuration file which customizes the UPS installation on a node or cluster
- a UPD configuration file that tells UPD which database to use to declare a product, where to install the product, and other information.
- the UPS and UPD executables which manipulate and view the database(s) on client and server nodes
- the $PRODUCTS environment variable that points to the UPS database(s) on the system. If there are multiple UPS databases, the order of the colon-separated databases in the list reflects the order of precedence.
9.1.1 UPS Products
Products distributed and managed by UPS on a distribution or user node are called UPS products. Typically, UPS products on a system are declared in a UPS database on that system. UPS products are generally self-contained and portable, laid out in a directory structure under what we call a product root directory. Following are terms and concepts associated with UPS products:
- Versions
- UPS supports multiple concurrent versions of software products. Each version of a product is installed and accessed independently of other versions.
- Flavors
- Many programs require separate compilations for each of the different UNIX operating systems. To distinguish between different OS-dependent compilations of a product, we use the term flavor .
- Qualifiers
- The product developer or installer may include information about options used at compilation time (e.g., debug or optimized) or other qualifying information for easy identification of special compilations. This information is declared in the form of qualifiers in a database.
- Product Instances
- Each installed copy of a product that is declared to a UPS database is called an instance of the product. Within a database, a product instance is distinguished by a unique combination of product name, version, flavor, and qualifiers.
- Chains
- Additional chains may be defined by developers and installers and other users. The command option -g <chainName> is provided for this purpose.
- Product Dependencies
- Many UPS products require that other products be installed, declared and setup for proper functioning or for use of special features. These other products are referred to as dependencies. Dependencies may be required or optional. End users don't normally need to know what dependencies a particular product has, as long as the product runs without problems. You need only setup a single UPS product to access any and all of the products listed as dependencies for that product.
9.1.2 UPS and UPD Commands
Syntax
Most UPS and UPD commands are of the form ups <command> or upd <command> (the exceptions are setup and unsetup), and take a variety of command line options and arguments. Multiple arguments must be separated by colons (:). The standard syntax is:
% ups <command> [<options>] <product> [<version>]% ups list -f IRIX+6:OSF1+V3 xemacs v20_4The first occurring unflagged argument on the line after the command is generally interpreted as the product name, and the next (if any) is interpreted as the version. With that limitation, the name, version and options can occur anywhere on the command line.
Defaults
- If no database is given, UPS uses $PRODUCTS to determine the database location.
- If no instance-identifying options or version are given, UPS/UPD operates on the instance declared as current for the flavor of the machine on which the command is issued (to the highest specification level possible). If there is no instance declared with the chain "current" or if the current instance has any qualifiers, then the default instance matching will fail.
- For UPD commands, if no product distribution node is specified using -h <node>, UPD uses the central Computing Division product server fnkits.fnal.gov as the default. (The product distribution database on this node is known as KITS.)
Resources for Help on Commands
A complete command reference is included in the first part of the Complete Guide and Reference Manual for UPS, UPD and UPP v4 (GU0014A) on the Web at http://www.fnal.gov/docs/products/ups/ReferenceManual/html/upscommands.html ( UPS commands), and http://www.fnal.gov/docs/products/ups/ReferenceManual/html/updcommands.html ( UPD commands).
To get online command usage information or help:
- Run the command with "-?", e.g., ups list "-?", to get an option listing. The double quotes are necessary for C shell users; -? is interpreted by sh .
- Man pages are also provided; use an underscore with the UPS command when running man, e.g., man ups_list .
9.2 UPS Operations for the End User
9.2.1 Determining your Machine's Flavor
The ups flavor command returns flavor information about the machine issuing the command. When entered with no options, the command returns the full OS specification of the machine, for example:
% ups flavorSunOS+5.69.2.2 Listing Product Information in a UPS Database
The ups list command returns information about the declared product instances in a local UPS database. The upd list command performs the same function on a distribution database. End users typically use these commands for finding out what products are in the database, what the current version of a product is for their machine's flavor and what other versions might be available. Product installers and other administrative users can use them to get detailed information about a product's installation and to find product files. Two output styles are provided: a formatted one that is easy for users to read, and a condensed one for parsing by a subsequent command or a script.
Specify the information that you want in the output by including various options and arguments in the command.
As is standard in UPS , if no chain, version or flavor is specified, and -a (for all instances) is not specified, UPS returns only the instance declared as "current" for the best-matched flavor of the requesting machine. Here we show the command syntax including several of the commonly-used options:
The upd list command syntax is identical except that it also takes a -h <node> option to specify a distribution node.
Formatted Output Style
One output style is for visual parsing (this is the default output, which we call formatted ), with multi-line output, e.g.,:
% ups list xemacsDATABASE=/usr/upsII/ups_database/declared/oss Product=xemacs Version=v19_14 Flavor=SunOS+5 Qualifiers="" Chain=currentNotice that the product name, version, flavor, qualifiers and chain(s) are the fields that get returned by default. The database (first line of the output) is included as a header, not as part of the per-instance data.
Condensed Output Style
The other output format is a script-readable, or condensed , format, provided to allow parsing by a subsequent command. Use the -K option (upper case) to request output in the condensed format. The -K option requires an argument list specifying which fields to include in the output. Some usage notes:
- The arguments for -K are not case-sensitive.
- The plus sign (+) argument, e.g., -K+, is a shorthand for requesting the default fields product:version:flavor:qualifiers:chain.
- Leaving a space immediately after the -K is optional.
- Separate the keywords using colons (:)
- You cannot use -l and -K together.
Example: List All Current Products
The simplest way to request a listing of all the current product instances in your default UPS database is to use the ups list command with no options or arguments:
% ups listDATABASE=/afs/fnal.gov/ups/db Product=admintools Version=v1 Flavor=SunOS+5 Qualifiers="" Chain=current Product=afsemu Version=v1_2 Flavor=NULL Qualifiers="" Chain=current Product=aixserv Version=v2_6_8 Flavor=NULL Qualifiers="" Chain=current Product=ansys Version=v5_3 Flavor=SunOS+5 Qualifiers="" Chain=current ... Product=ximagetools Version=v3_1 Flavor=SunOS+5 Qualifiers="" Chain=current Product=xntp Version=v3_4 Flavor=SunOS+5 Qualifiers="" Chain=current Product=xpdf Version=v0_7 Flavor=SunOS+5 Qualifiers="" Chain=current Product=zephyr Version=v2_0_4 Flavor=SunOS+5 Qualifiers="" Chain=currentUse of the -K option with the + argument provides the same information as the previous example, but condensed to one line per product, e.g.,:
% ups list -K+"admintools" "v1" "SunOS+5" "" "current" "afsemu" "v1_2" "NULL" "" "current" "aixserv" "v2_6_8" "NULL" "" "current" "ansys" "v5_3" "SunOS+5" "" "current" ... "ximagetools" "v3_1" "SunOS+5" "" "current" "xntp" "v3_4" "SunOS+5" "" "current" "xpdf" "v0_7" "SunOS+5" "" "current" "zephyr" "v2_0_4" "SunOS+5" "" "current"
If $PRODUCTS contains multiple databases, output is returned for the selected products in all of them. However, when using -K, the database is identified for each output line only if the keyword DATABASE or DB is included in the argument string (e.g., -K+:DB requests the standard output fields followed by the database path):
% ups list -aK+:DB"admintools" "v1" "SunOS+5" "" "current" "/afs/fnal.gov/ups/db" "afsemu" "v1_2" "NULL" "" "current" "/usr/products/ups_database/main" ...Example: List All Product Instances
Use the -a option to list all instances (-a for all) of the product emacs :
% ups list -a emacsDATABASE=/afs/fnal.gov/ups/db Product=emacs Version=v19_30a Flavor=IRIX+5 Qualifiers="" Chain="" Product=emacs Version=v19_30a Flavor=SunOS+5 Qualifiers="" Chain="" ... Product=emacs Version=v19_34b Flavor=SunOS+5 Qualifiers="" Chain=currentUse the -K+ option/argument and pipe the output to the grep command, e.g.,:
% ups list -aK+ emacs | grep SunOS+5"emacs" "v19_30a" "SunOS+5" "" "" ... "emacs" "v19_34b" "SunOS+5" "" "current"Example: Specify Output Fields to List
Instead of using the + argument with -K to get the default fields, you can specify particular fields. For example, to output a list of product names and version numbers for all the current products, use the command:
% ups list -K product:version"admintools" "v1" "afsemu" "v1_2" "aixserv" "v2_6_8" "ansys" "v5_3" ... "ximagetools" "v3_1" "xntp" "v3_4" "xpdf" "v0_7" "zephyr" "v2_0_4"Example: List Detailed Information for a Product Instance
Administrative users may need detailed information about a product which the -l option (lower case -L) provides. A request for information on the current instance of a single product using the long output format (not available with the -K option) gives the following:
% ups list exmh -lDATABASE=/afs/fnal.gov/ups/db Product=exmh Version=v2_0_2 Flavor=NULL Qualifiers= "" Chain=current Declared="1998-11-17 15.04.41 GMT:1998-10-22 16.31.12 GMT" Declarer="lauri:lauri" Modified="1998-11-17 15.04.41 GMT:1998-10-22 16.31.12 GMT" Modifier="lauri:lauri" Home=/afs/fnal.gov/ups/exmh/v2_0_2/NULL No Compile Directive Authorized, Nodes=* UPS_Dir="ups" Table_Dir="" Table_File="v2_0_2.table" Archive_File="" Description="" Action=setup prodDir() setupEnv() setupRequired(expect) setupRequired(mh) setupRequired(mimetools) setupOptional(glimpse) setupOptional(www) setupOptional(netscape) setupOptional(ispell) pathPrepend(PATH,${UPS_PROD_DIR}/bin) envSetIfNotSet(NETSCAPE_DIR, "$HOME") Action=current prodDir() execute(${UPS_UPS_DIR}/current, UPS_ENV)This gives a fairly long list. It is often more convenient to use the -K option with a list of keywords for the specific fields you need.
9.2.3 Finding a Product's Dependencies
The ups depend command lists dependencies of specified product instance(s) as declared in the local UPS database. You can use it to determine what products will get setup along with your main product, or to determine what products need to be available in order to successfully setup the main one. The upd depend command performs the same function on a distribution database. Shown with some commonly-used options, the command syntax is:
% ups depend [-f <flavorList>] [<chainFlag>] [-j] \ [-K <keywordList>] [-q <qualifierList>] [-R] <product> [<version>]The upd depend command syntax is identical except that it also takes a -h <node> option to specify a distribution node.
Examples
The first example requests information for the default instance of exmh , which is the one chained to "current" for the best-match flavor of the machine (SunOS+5 for this example):
% ups depend exmhexmh v2_0_2 -f NULL -z /afs/fnal.gov/ups/db -g current |__expect v5_25 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | |__tk v8_0_2 -f SunOS+5 -z /afs/fnal.gov/ups/db | |__tcl v8_0_2 -f SunOS+5 -z /afs/fnal.gov/ups/db |__mh v6_8_3c -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | |__mailtools v2_3 -f NULL -z /afs/fnal.gov/ups/db -g current |__mimetools v2_7a -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__glimpse v3_0a -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__www v3_0 -f NULL -z /afs/fnal.gov/ups/db -g current | |__netscape v4_05 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | | |__ghostview v4_0 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | | |__ximagetools v4_0 -f NULL -z /afs/fnal.gov/ups/db -g current | | | |__imagelibs v1_0 -f SunOS+5 -z /afs/fnal.gov/ups/db | | | |__imagemagick v4_04 -f SunOS+5 -z /afs/fnal.gov/ups/db | | | |__xfig v3_20 -f SunOS+5 -z /afs/fnal.gov/ups/db | | | |__xanim v2_70_64 -f SunOS+5 -z /afs/fnal.gov/ups/db | | |__xpdf v0_7 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | |__lynx v2_8_1 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__ispell v3_1b -f SunOS+5 -z /afs/fnal.gov/ups/db -g currentWe use the -R option to request only the dependencies listed as "required" for the same product instance as in the previous example:
% ups depend -R exmhexmh v2_0_2 -f NULL -z /afs/fnal.gov/ups/db -g current |__expect v5_25 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | |__tk v8_0_2 -f SunOS+5 -z /afs/fnal.gov/ups/db | |__tcl v8_0_2 -f SunOS+5 -z /afs/fnal.gov/ups/db |__mh v6_8_3c -f SunOS+5 -z /afs/fnal.gov/ups/db -g current | |__mailtools v2_3 -f NULL -z /afs/fnal.gov/ups/db -g current |__mimetools v2_7a -f SunOS+5 -z /afs/fnal.gov/ups/db -g currentThe ups depend command accepts the -K option to return a subset of the output fields. Here, we use the -R option again with the same product instance (this allows you to compare the output to the previous example), and we use -K to specify output fields:
% ups depend -RK product:version:flavor exmh"exmh" "v2_0_2" "NULL" "expect" "v5_25" "SunOS+5" "tk" "v8_0_2" "SunOS+5" "tcl" "v8_0_2" "SunOS+5" "mh" "v6_8_3c" "SunOS+5" "mailtools" "v2_3" "NULL" "mimetools" "v2_7a" "SunOS+5"Use the -j option to request "just" the direct dependencies of the specified product, omitting dependencies of dependencies (again, the same instance is used to allow comparison):
% ups depend -j exmhexmh v2_0_2 -f NULL -z /afs/fnal.gov/ups/db -g current |__expect v5_25 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__mh v6_8_3c -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__mimetools v2_7a -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__glimpse v3_0a -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__www v3_0 -f NULL -z /afs/fnal.gov/ups/db -g current |__netscape v4_05 -f SunOS+5 -z /afs/fnal.gov/ups/db -g current |__ispell v3_1b -f SunOS+5 -z /afs/fnal.gov/ups/db -g current9.2.4 Setting up a Product
An installed, declared UPS product instance requires that the setup command be issued prior to use, unless it has already been set up as a dependency of another product. The setup command performs the necessary operations in your login environment to make an installed, declared product accessible to you. Typically, the operations include modifying environment variables or adding to your $PATH. Many options are available for the setup command. Here we show the syntax with a few of the more commonly-used options:
% setup [-f <flavor>] [<chainFlag>] [-z <databaseList>]\ <product> [<version>]
Note that you can only have one instance of a product setup at a time. Each time you run setup on an additional instance of the same product, the previously active instance is automatically unsetup first.
The setup Command for Typical Cases
Typically users want to setup the default current version of a product. This is very simple, you just need to specify the product name. For example, to setup the current instance of tex for the best-matched flavor of your OS, enter:
% setup texTo setup any other chained instance, include the chain flag in the command. To find out what's available, first issue a ups list command (see section 9.2.2 Listing Product Information in a UPS Database). For example, before setting up the instance of tex declared as "old", make sure it's available, e.g.,:
% ups list -aoK+ tex"tex" "v3_1415a" "IRIX+5" "" "old" "tex" "v3_1415a" "OSF1+V3" "" "old"If your machine's flavor corresponds to one that is listed, then you can go ahead and issue this setup command:
% setup -o texTo setup an unchained instance of a product, include its version number. First, let's find one:
% ups list -aK+ -f IRIX+4 tex"tex" "v3_1415a" "IRIX+4" "" ""If you're on an IRIX+4 machine, you can setup version v3_1415a of tex by issuing the command:
% setup tex v3_1415aWhen You Need to Specify Other Options
As simple as it is to use in everyday situations, setup is equipped with a host of options that allow you to specify precisely which instance to setup, and in some cases, how to set it up. We do not go into detail here about the more complex cases. However, it is worth mentioning a few options:
- -j
- By default, the UPS product dependencies are setup recursively along with the main product. Use the -j option to restrict the setup to just the specified product and none of its dependencies, e.g., % setup -j exmh.
- -R
- This sets up the specified product and its required dependencies only.
- -q
- To setup any product instance that has been declared with qualifiers, the exact set of qualifiers must be specified on the command line using the -q option. Qualifiers are case-sensitive, and must be entered on the command line exactly as they appear in the product declaration.
9.2.5 Running Unsetup on a Product
unsetup is intended to undo the changes to your software environment made during product setup. It makes the product no longer available for use. You may need to explicitly unsetup a UPS product if you are short on environment variable space and want to get rid of extra environment variables or shorten the $PATH variable length. Unsetup gets done automatically for you when you setup a different instance of the same product.
When you no longer need to access a product, in most cases you can simply type:
% unsetup <product>% unsetup texIf you just want to unsetup your main product and leave its product dependencies setup, include the -j option in your unsetup command, for example:
% unsetup -j <product>If unsetup doesn't work as you expect for a particular product, see section 22.2 of the UPS/UPD manual (GU0014A). Online, go to Use of the $SETUP_<PRODUCT> Variable under http://www.fnal.gov/docs/products/ups/ReferenceManual/html/upscommands.html#38439 for an explanation of how the behavior of unsetup depends on the product's implementation.
9.3 Installing UPS Products
There are three ways to download products from a UPS product distribution node and install them locally: using UPD , FTP plus UPS, or UPP . These methods are all discussed in the second volume of the Complete Guide and Reference Manual for UPS, UPD and UPP v4 (GU0014B). Here we will discuss only "vanilla" installations using UPD .
The UPD product includes the upd install command for installing products. Installation parameters are set in the local node's UPD configuration. These are described in the UPS/UPD manual's section 3.3 What You Need to Know about Your System's UPD Configuration on the Web at http://www.fnal.gov/docs/products/ups/ReferenceManual/html/gen_install.html#69820 . If your local node has multiple UPS databases and/or product areas, you may want to check this.
9.3.1 User Node Registration for KITS Database
First of all, if you want to download products from the KITS database, the machine you're using must be registered with fnkits.fnal.gov . All machines in the fnal.gov domain are automatically registered. Off-site machines need to register using the Product Distribution Platform Registration Request form at http://www.fnal.gov/cd/forms/upd_registration.html.
If you only want to download FermiTools products, which are located under the /pub directory in KITS, you do not need to be using a registered node. FermiTools are made available to the general public.
9.3.2 upd install Command Functions
The upd install command performs the following functions:
- retrieves the specified product instance, and by default its dependencies, from a distribution node
- unwinds the product (if transferred in tar format) and installs it, and by default its dependencies, on the user node according to the node's UPD configuration
- declares the product, and by default its dependencies, to the database specified in the node's UPD configuration
- either resolves dependencies or prints to screen the commands you will need to issue in order to do so
9.3.3 upd install Command Syntax
The command syntax, showing some commonly used options, is:
% upd install [<chainFlag>] [-G "<options>"] [-h <host>] \ [-H <flavor>] [-q <qualifiers>] [-X] [-z <database>] \ [<other options>] <product> [version]
- <chainFlag>
- -g <chainName>
- -G "<options>"
- Specifies options to be passed to the local ups declare command. The elements valid for use with -G include <product>, <version> and a subset of the ups declare options. The most commonly used include: -c (or other chain specification), -f <flavor>, -q <qualifierList>, -z <database>
- -h <host>
- Specifies product distribution host; the default is fnkits.fnal.gov .
- -H <flavor>-q <qualifiers>
- Finds product instance on distribution node with the specified qualifiers (required and/or optional)
- -X
- Executes the generated ups declare commands needed to resolve dependencies. If -X is not included, ups install echoes to the screen the commands you'll need to run.
- -z <database>
- Specifies the local database(s) in which product and its dependencies can be installed.
9.3.4 Examples
Install a Product Using Defaults, and Declare as Current
This illustrates one of the simplest cases: installing the current instance of a product for the best-match flavor of the local machine, letting UPS determine the target database using $PRODUCTS, and declaring it "current" on the local system. For this example, we choose a product with no dependencies (if it had any, they would also get installed and declared as "current").
First, check the default instance on the server:
% upd list -K+ teledata"teledata" "v1_0" "NULL" "" "current"Check which instances already exist in the database(s) listed in $PRODUCTS:
% ups list -aK+ teledata(if no output, then no instances)% upd install teledata -G "-c"informational: installed teledata v1_0. informational: product teledata has an INSTALL_NOTE; you should read /export/home/t1/aheavey/upsII/products/teledata/v1_0//ups/INSTALL_NOTE.Read the INSTALL_NOTE file to see if you need to do anything (we'll not document this part since it is product-specific). Next, verify that the instance is declared as "current" in $PRODUCTS:
% ups list -aK+ teledata"teledata" "v1_0" "NULL" "" "current"Install a Product, Specifying Database
Perform the installation normally, (as shown in section Install a Product Using Defaults, and Declare as Current) but include the -z option, e.g.,:
% upd install -z $MYDB teledata [<other options>]% upd install -z /path/to/my/database teledata [<other options>]These are equivalent assuming $MYDB is set to /path/to/my/database.
Install a Product and No Dependencies
Perform the installation normally, but include the -j option, e.g.,:
% upd install -j <product> [<version>] [<other options>]The specified product gets installed, but none of its dependencies do.