1 .TH STOW 8 "28 March 1998"
3 stow \- software package installation manager
9 This manual page describes GNU Stow 1.3.3, a program for managing the
10 installation of software packages. This is not the definitive
11 documentation for stow; for that, see the info manual.
13 Stow is a tool for managing the installation of multiple software
14 packages in the same run-time directory tree. One historical difficulty
15 of this task has been the need to administer, upgrade, install, and
16 remove files in independent packages without confusing them with other
17 files sharing the same filesystem space. For instance, it is common to
18 install Perl and Emacs in
20 When one does so, one winds up
21 (as of Perl 4.036 and Emacs 19.22)
22 with the following files in
23 .IR /usr/local/man/man1 :
33 suppose it's time to uninstall Perl. Which man pages get removed?
36 is one of them, but it should not be the
37 administrator's responsibility to memorize the ownership of individual
38 files by separate packages.
40 The approach used by Stow is to install each package into its own
41 tree, then use symbolic links to make it appear as though the files are
42 installed in the common tree. Administration can be performed in the
43 package's private tree in isolation from clutter from other packages.
44 Stow can then be used to update the symbolic links. The structure of
45 each private tree should reflect the desired structure in the common
46 tree; i.e. (in the typical case) there should be a
49 containing executables, a
51 directory containing section 1 man
54 Stow was inspired by Carnegie Mellon's Depot program, but is
55 substantially simpler and safer. Whereas Depot required database files
56 to keep things in sync, Stow stores no extra state between runs, so
57 there's no danger (as there was in Depot) of mangling directories when
58 file hierarchies don't match the database. Also unlike Depot, Stow will
59 never delete any files, directories, or links that appear in a Stow
61 .IR /usr/local/stow/emacs ),
62 so it's always possible to
63 rebuild the target tree (e.g.,
66 A ``package'' is a related collection of files and directories that
67 you wish to administer as a unit--e.g., Perl or Emacs--and that needs
68 to be installed in a particular directory structure--e.g., with
75 A ``target directory'' is the root of a tree in which one or more
78 to be installed. A common, but by no means
79 the only such location is
81 The examples in this manual page
84 as the target directory.
86 A ``stow directory'' is the root of a tree containing separate
87 packages in private subtrees. When Stow runs, it uses the current
88 directory as the default stow directory. The examples in this manual
91 as the stow directory, so that individual
92 packages will be, for example,
93 .I /usr/local/stow/perl
95 .IR /usr/local/stow/emacs .
97 An ``installation image'' is the layout of files and directories
98 required by a package, relative to the target directory. Thus, the
99 installation image for Perl includes: a
107 directory containing Texinfo
110 directory containing Perl libraries; and a
112 directory containing man pages.
114 A ``package directory'' is the root of a tree containing the
115 installation image for a particular package. Each package directory
116 must reside in a stow directory--e.g., the package directory
117 .I /usr/local/stow/perl
118 must reside in the stow directory
119 .IR /usr/local/stow .
120 The ``name'' of a package is the name of its
121 directory within the stow directory--e.g.,
124 Thus, the Perl executable might reside in
125 .IR /usr/local/stow/perl/bin/perl ,
131 is the stow directory,
132 .I /usr/local/stow/perl
133 is the package directory, and
136 is part of the installation image.
138 A ``symlink'' is a symbolic link. A symlink can be ``relative'' or
139 ``absolute''. An absolute symlink names a full path; that is, one
142 A relative symlink names a relative path; that is,
143 one not starting from
145 The target of a relative symlink is
146 computed starting from the symlink's own directory. Stow only creates
149 The stow directory is assumed to be the value of the 'STOW_DIR' environment
150 variable or if unset the current directory, and the
151 target directory is assumed to be the parent of the current directory
152 (so it is typical to execute
155 .IR /usr/local/stow ).
158 given on the command line is the name of a package in the stow
161 By default, they are installed into the
162 target directory (but they can be deleted instead using `-D').
167 Do not perform any operations that modify the filesystem; merely
168 show what would happen. Since no actual operations are performed,
170 could report conflicts when none would actually take
171 place (see ``Conflicts'' in the info manual);
172 but it won't fail to report conflicts
180 Do not exit immediately when a conflict is encountered. This
181 option implies `-n', and is used to search for all conflicts that
182 might arise from an actual Stow operation. As with `-n', however,
183 false conflicts might be reported (see ``Conflicts'' in the info manual).
188 Set the stow directory to DIR instead of the current directory.
189 This also has the effect of making the default target directory be
195 Set the target directory to DIR instead of the parent of the stow
201 Send verbose output to standard error describing what Stow is
202 doing. Verbosity levels are 0, 1, 2, and 3; 0 is the default.
203 Using `-v' or `--verbose' increases the verbosity by one; using
204 `--verbose=N' sets it to N.
209 Delete packages from the target directory rather than installing
215 Restow packages (first unstow, then stow again). This is useful
216 for pruning obsolete symlinks from the target tree after updating
217 the software in a package.
222 Show Stow version number, and exit.
227 Show Stow command syntax, and exit.
228 .SH "INSTALLING PACKAGES"
229 The default action of Stow is to install a package. This means
230 creating symlinks in the target tree that point into the package tree.
231 Stow attempts to do this with as few symlinks as possible; in other
232 words, if Stow can create a single symlink that points to an entire
233 subtree within the package tree, it will choose to do that rather than
234 create a directory in the target tree and populate it with symlinks.
236 For example, suppose that no packages have yet been installed in
238 it's completely empty (except for the
240 subdirectory, of course). Now suppose the Perl package is installed.
241 Recall that it includes the following directories in its installation
250 and populating it with symlinks to
251 .I ../stow/perl/bin/perl
253 .I ../stow/perl/bin/a2p
255 will create a single symlink,
259 In this way, it still works to refer to
260 .I /usr/local/bin/perl
262 .IR /usr/local/bin/a2p ,
263 and fewer symlinks have
264 been created. This is called ``tree folding'', since an entire subtree
265 is ``folded'' into a single symlink.
267 To complete this example, Stow will also create the symlink
280 Now suppose that instead of installing the Perl package into an empty
281 target tree, the target tree is not empty to begin with. Instead, it
282 contains several files and directories installed under a different
283 system-administration philosophy. In particular,
285 already exists and is a directory, as are
288 .IR /usr/local/man/man1 .
289 In this case, Stow will descend into
291 and create symlinks to
292 .I ../stow/perl/bin/perl
294 .I ../stow/perl/bin/a2p
295 (etc.), and it will descend into
297 and create the tree-folding symlink
300 .IR ../stow/perl/lib/perl ,
301 and so on. As a rule, Stow only descends as
302 far as necessary into the target tree when it can create a tree-folding
305 The time often comes when a tree-folding symlink has to be undone
306 because another package uses one or more of the folded subdirectories in
307 its installation image. This operation is called ``splitting open'' a
308 folded tree. It involves removing the original symlink from the target
309 tree, creating a true directory in its place, and then populating the
310 new directory with symlinks to the newly-installed package
313 old package that used the old symlink. For example, suppose that after
314 installing Perl into an empty
316 we wish to install Emacs.
317 Emacs's installation image includes a
319 directory containing the
323 executables, among others. Stow must make these
324 files appear to be installed in
331 the following steps: the symlink
336 is created; links are made from
339 .I ../stow/emacs/bin/emacs
341 .IR ../stow/emacs/bin/etags ;
342 and links are made from
345 .I ../stow/perl/bin/perl
347 .IR ../stow/perl/bin/a2p .
349 When splitting open a folded tree, Stow makes sure that the symlink
350 it is about to remove points inside a valid package in the current stow
352 .BR "Stow will never delete anything that it doesn't own" .
353 Stow ``owns'' everything living in the target tree that points into a
354 package in the stow directory. Anything Stow owns, it can recompute if
355 lost. Note that by this definition, Stow doesn't ``own'' anything
357 the stow directory or in any of the packages.
359 If Stow needs to create a directory or a symlink in the target tree
360 and it cannot because that name is already in use and is not owned by
361 Stow, then a conflict has arisen. See ``Conflicts'' in the info manual.
362 .SH "DELETING PACKAGES"
363 When the `-D' option is given, the action of Stow is to delete a
364 package from the target tree. Note that Stow will not delete anything
365 it doesn't ``own''. Deleting a package does
367 mean removing it from
368 the stow directory or discarding the package tree.
370 To delete a package, Stow recursively scans the target tree,
371 skipping over the stow directory (since that is usually a subdirectory
372 of the target tree) and any other stow directories it encounters (see
373 ``Multiple stow directories'' in the info manual). Any symlink it finds that points into
374 the package being deleted is removed. Any directory that contained
375 only symlinks to the package being deleted is removed. Any directory
376 that, after removing symlinks and empty subdirectories, contains only
377 symlinks to a single other package, is considered to be a previously
378 ``folded'' tree that was ``split open.'' Stow will re-fold the tree by
379 removing the symlinks to the surviving package, removing the directory,
380 then linking the directory back to the surviving package.
382 The info manual ``Stow 1.3.3:
383 Managing the installation of software packages''
384 by Bob Glickstein, Zanshin Software, Inc.
386 Please report bugs in Stow using the Debian bug tracking system.
388 Currently known bugs include:
390 The empty-directory problem. If package FOO includes an empty
391 directory--say, FOO/BAR--then:
394 if no other package has a BAR subdirectory, everything's fine.
397 if another stowed package, QUUX, has a BAR subdirectory, then
398 when stowing, TARGETDIR/BAR will be ``split open'' and the
399 contents of QUUX/BAR will be individually stowed. So far, so
400 good. But when unstowing QUUX, TARGETDIR/BAR will be
401 removed, even though FOO/BAR needs it to remain. A
402 workaround for this problem is to create a file in FOO/BAR as
403 a placeholder. If you name that file
406 be easy to find and remove such files when this bug is fixed.
408 When using multiple stow directories (see ``Multiple stow
409 directories'' in the info manual), Stow fails to ``split open'' tree-folding symlinks
410 (see ``Installing packages'' in the info manual) that point into a stow directory
411 which is not the one in use by the current Stow command. Before
412 failing, it should search the target of the link to see whether
413 any element of the path contains a
415 file. If it finds one,
416 it can ``learn'' about the cooperating stow directory to
419 search the next time it encounters a
420 tree-folding symlink.
422 This man page was constructed by Charles Briscoe-Smith from
423 parts of Stow's info manual. That manual contained the following
424 notice, which, as it says, applied to this manual page, too. The text
425 of the section entitled ``GNU General Public License'' can be found in
427 .I /usr/share/common-licenses/GPL
428 on any Debian GNU/Linux system. If you don't have access to a Debian
429 system, or the GPL is not there, write to the Free Software Foundation,
430 Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA.
432 Software and documentation Copyright (C) 1993, 1994, 1995, 1996 by
433 Bob Glickstein <bobg+stow@zanshin.com>.
435 Permission is granted to make and distribute verbatim copies of this
436 manual provided the copyright notice and this permission notice are
437 preserved on all copies.
439 Permission is granted to copy and distribute modified versions of
440 this manual under the conditions for verbatim copying, provided also
441 that the section entitled ``GNU General Public License'' is included with
442 the modified manual, and provided that the entire resulting derived
443 work is distributed under the terms of a permission notice identical to
446 Permission is granted to copy and distribute translations of this
447 manual into another language, under the above conditions for modified
448 versions, except that this permission notice may be stated in a
449 translation approved by the Free Software Foundation.