pkg - global pkg control utility


pkg [-help|-u] [-arch arch] [-coll coll] [-pkg pkg] [-n|-dry] [-debug level] [-commmon] [-src dir] [-cfg file] [-create-software]


The pkg system is designed to ease the installation and maintenance of a large number of GNU style software packages. The following scripts make up the pkg system.

 pkg            - global control utility
 pkg-env        - sets up pkg environment for the rest of the tools
 pkg-new        - creates a new package 
 pkg-configure  - runs the configure script from the package with 
                  the correct settings
 pkg-make       - runs make with correct settings
 pkg-makeinst   - runs "make install" with correct settings
 pkg-copyout    - utility to archive output files from configure, 
                  make and make install 
 pkg-empty      - removes empty directories in the installed package
 pkg-link       - link in a package into a software tree
 pkg-local      - link in the software tree links into /usr/local
 pkg-unlink     - undoes the results of pkg-link
 pkg-www        - 
 pkg-regression - checks the software tree for integrity

Common Usage Instructions

The following illustrates a typical usage scenario for package.

1. Download the software from a distribution site and unpack it in the source directories. Ideally you should unpack into a source directory in the proper collection tree. This way pkg can pick up the collection and package name automatically. If you're maintaining a flat source tree then you'll need to set the collection environment variable (PKG_COLL) or pass in the collection with the -coll argument.

2. CD into the package directory.

2. Run pkg-env. Pay attention to the settings that pkg-env determines. Make sure that it picks up the correct architecture, collection and package names. If you're buidling software that consists entirely of portable scripts then you should specify -common to pkg-env to start a common only install.

3. Run pkg-new. This will create a package directory in the proper architecture and collection. It will also create a package in the common (OS independent) architecture.

4. Read the installation instructions for the software. Substitute all reference to configure, make and make install steps with pkg-configure, pkg-make and pkg-makeinst respectively. Follow the rest of the instructions and write the steps taken into a pkg-name.notes file that you should create either in the package directory or in ~ (home directory).

5. If the installation was successful test the software by running it out of the package directory in the software tree.

6. Run pkg-copyout to copy the .out files and the .notes files into the package/admin directory in the software tree.

7. Run pkg-empty to remove empty directories in the architecture specific and common directories for the package.

8. Run pkg-link to link in the package into the software tree.

9. Run pkg-local -pkgonly to link the current package into /usr/local


Outputs the common usage information.

Sets the architecture for the creation of this package.

Sets the collection for the creation of this package.

Sets the package name for the creation of this package.

Only print the calls that pkg-empty would normally execute, but do not actually execute them.

-[d]ebug [level]
Outputs some debuging information based on specified level. If the level is not specified the default is 3. The debug range is 0-9.

Specifies that this is a common only install. pkg-empty will only go through the common architecture and delete empty package subdirectories there.

Specifies where the source distribution files are for the package.

Specifies a different configuration file to use.

Creates a new software tree based on the configuration file settings.


pkg returns a 0 if completed successfully. Otherwise it returns a 1.












Pkg was developed by Mathematics and Computer Science Division of Argonne National Laboratory. Specifically the following people contributed: Remy Evard, Chris Weslowski, Emir Mulabego, Dan Nurmi, Ti Leggett, Mike Gomberg