Option Directories -- Rationale

Usage

In more modern SysV R4 Unix systems and their derivatives, the /opt directory has begun to be used as a location for installation of software "option" packages--things that aren't part of the "base" OS installation. So far, we have seen this directory used for

To this list, we add two other categories of software: Packages in the first of these two categories (net-supported) have traditionally been installed in /usr/local or some other, even less standard equivalent. The second category has been installed in a variety of places based on local custom.

We feel that the latter two categories are sufficiently similar to the other sorts of "option" packages that they should be treated in a similar fashion, and located in the same directory tree.


The Package Philosophy

When using /usr/local or similar installation points, a package is typically distributed throughout several parallel directory trees: /usr/local/bin for the binaries, /usr/local/lib for any related libraries, and often for configuration information, /usr/local/man for manual pages, and so on. Upgrading or uninstalling a package can be a tricky and time-consuming proposition.

The /opt package concept attempts to rectify this scattering of files by collecting all installed files related to a given package into a single directory, normally referred to as /opt/appname. Thus an application's executable binaries would be in /opt/appname/bin, its library files in /opt/appname/lib, its man pages in /opt/appname/man, and so on.

This single-tree approach greatly simplifies the management of multiple versions of a given package, including upgrades, and also makes uninstalling a package a snap.


Addressing Common Problems

The obvious approach would be therefore to simply create an /opt/appname directory, install an application into it, and be done with it. However, experience has shown that this simplistic method leads to several maintenance problems:

We have therefore devised a system of subdirectories and symbolic links which addresses these issues in a fairly flexible manner. This design is the result of several years of experience, and has evolved considerably from its original form. (Yes, we started with simple /opt/appname directories, too!) There is every reason to believe that it will continue to evolve in the future, although it has served well for over a year, at multiple sites, in the form described here.


Open Questions

We haven't solved all the issues surrounding this question, and some of the parts described in the following sections are still open to some debate. You may wish to skip this section on your first reading, and refer back to it as you read the rest of the document.

Some of the problems and questions we still have:

These and other questions will probably always be around, and serve to drive the evolution of this system into something even better.


Last modified: Wed 26 Nov 1997