1STOW(8) System Manager's Manual STOW(8)
2
3
4
6 stow - software package installation manager
7
9 stow [options] package...
10
12 This manual page describes GNU Stow 1.3.3, a program for managing the
13 installation of software packages. This is not the definitive documen‐
14 tation for stow; for that, see the info manual.
15
16 Stow is a tool for managing the installation of multiple software pack‐
17 ages in the same run-time directory tree. One historical difficulty of
18 this task has been the need to administer, upgrade, install, and remove
19 files in independent packages without confusing them with other files
20 sharing the same filesystem space. For instance, it is common to
21 install Perl and Emacs in /usr/local. When one does so, one winds up
22 (as of Perl 4.036 and Emacs 19.22) with the following files in
23 /usr/local/man/man1: a2p.1; ctags.1; emacs.1; etags.1; h2ph.1; perl.1;
24 and s2p.1. Now suppose it's time to uninstall Perl. Which man pages
25 get removed? Obviously perl.1 is one of them, but it should not be the
26 administrator's responsibility to memorize the ownership of individual
27 files by separate packages.
28
29 The approach used by Stow is to install each package into its own tree,
30 then use symbolic links to make it appear as though the files are
31 installed in the common tree. Administration can be performed in the
32 package's private tree in isolation from clutter from other packages.
33 Stow can then be used to update the symbolic links. The structure of
34 each private tree should reflect the desired structure in the common
35 tree; i.e. (in the typical case) there should be a bin directory con‐
36 taining executables, a man/man1 directory containing section 1 man
37 pages, and so on.
38
39 Stow was inspired by Carnegie Mellon's Depot program, but is substan‐
40 tially simpler and safer. Whereas Depot required database files to keep
41 things in sync, Stow stores no extra state between runs, so there's no
42 danger (as there was in Depot) of mangling directories when file hier‐
43 archies don't match the database. Also unlike Depot, Stow will never
44 delete any files, directories, or links that appear in a Stow directory
45 (e.g., /usr/local/stow/emacs), so it's always possible to rebuild the
46 target tree (e.g., /usr/local).
47
49 A ``package'' is a related collection of files and directories that you
50 wish to administer as a unit--e.g., Perl or Emacs--and that needs to be
51 installed in a particular directory structure--e.g., with bin, lib, and
52 man subdirectories.
53
54 A ``target directory'' is the root of a tree in which one or more pack‐
55 ages wish to appear to be installed. A common, but by no means the only
56 such location is /usr/local. The examples in this manual page will use
57 /usr/local as the target directory.
58
59 A ``stow directory'' is the root of a tree containing separate packages
60 in private subtrees. When Stow runs, it uses the current directory as
61 the default stow directory. The examples in this manual page will use
62 /usr/local/stow as the stow directory, so that individual packages will
63 be, for example, /usr/local/stow/perl and /usr/local/stow/emacs.
64
65 An ``installation image'' is the layout of files and directories
66 required by a package, relative to the target directory. Thus, the
67 installation image for Perl includes: a bin directory containing perl
68 and a2p (among others); an info directory containing Texinfo documenta‐
69 tion; a lib/perl directory containing Perl libraries; and a man/man1
70 directory containing man pages.
71
72 A ``package directory'' is the root of a tree containing the installa‐
73 tion image for a particular package. Each package directory must reside
74 in a stow directory--e.g., the package directory /usr/local/stow/perl
75 must reside in the stow directory /usr/local/stow. The ``name'' of a
76 package is the name of its directory within the stow directory--e.g.,
77 perl.
78
79 Thus, the Perl executable might reside in
80 /usr/local/stow/perl/bin/perl, where /usr/local is the target direc‐
81 tory, /usr/local/stow is the stow directory, /usr/local/stow/perl is
82 the package directory, and bin/perl within is part of the installation
83 image.
84
85 A ``symlink'' is a symbolic link. A symlink can be ``relative'' or
86 ``absolute''. An absolute symlink names a full path; that is, one
87 starting from /. A relative symlink names a relative path; that is,
88 one not starting from /. The target of a relative symlink is computed
89 starting from the symlink's own directory. Stow only creates relative
90 symlinks.
91
93 The stow directory is assumed to be the current directory, and the tar‐
94 get directory is assumed to be the parent of the current directory (so
95 it is typical to execute stow from the directory /usr/local/stow).
96 Each package given on the command line is the name of a package in the
97 stow directory (e.g., perl). By default, they are installed into the
98 target directory (but they can be deleted instead using `-D').
99
100 -n
101
102 --no Do not perform any operations that modify the filesystem; merely
103 show what would happen. Since no actual operations are per‐
104 formed, stow -n could report conflicts when none would actually
105 take place (see ``Conflicts'' in the info manual); but it won't
106 fail to report conflicts that would take place.
107
108 -c
109
110 --conflicts
111 Do not exit immediately when a conflict is encountered. This
112 option implies `-n', and is used to search for all conflicts
113 that might arise from an actual Stow operation. As with `-n',
114 however, false conflicts might be reported (see ``Conflicts'' in
115 the info manual).
116
117 -d DIR
118
119 --dir=DIR
120 Set the stow directory to DIR instead of the current directory.
121 This also has the effect of making the default target directory
122 be the parent of DIR.
123
124 -t DIR
125
126 --target=DIR
127 Set the target directory to DIR instead of the parent of the
128 stow directory.
129
130 -v
131
132 --verbose[=N]
133 Send verbose output to standard error describing what Stow is
134 doing. Verbosity levels are 0, 1, 2, and 3; 0 is the default.
135 Using `-v' or `--verbose' increases the verbosity by one; using
136 `--verbose=N' sets it to N.
137
138 -D
139
140 --delete
141 Delete packages from the target directory rather than installing
142 them.
143
144 -R
145
146 --restow
147 Restow packages (first unstow, then stow again). This is useful
148 for pruning obsolete symlinks from the target tree after updat‐
149 ing the software in a package.
150
151 -V
152
153 --version
154 Show Stow version number, and exit.
155
156 -h
157
158 --help Show Stow command syntax, and exit.
159
161 The default action of Stow is to install a package. This means creating
162 symlinks in the target tree that point into the package tree. Stow
163 attempts to do this with as few symlinks as possible; in other words,
164 if Stow can create a single symlink that points to an entire subtree
165 within the package tree, it will choose to do that rather than create a
166 directory in the target tree and populate it with symlinks.
167
168 For example, suppose that no packages have yet been installed in
169 /usr/local; it's completely empty (except for the stow subdirectory, of
170 course). Now suppose the Perl package is installed. Recall that it
171 includes the following directories in its installation image: bin;
172 info; lib/perl; man/man1. Rather than creating the directory
173 /usr/local/bin and populating it with symlinks to ../stow/perl/bin/perl
174 and ../stow/perl/bin/a2p (and so on), Stow will create a single sym‐
175 link, /usr/local/bin, which points to stow/perl/bin. In this way, it
176 still works to refer to /usr/local/bin/perl and /usr/local/bin/a2p, and
177 fewer symlinks have been created. This is called ``tree folding'',
178 since an entire subtree is ``folded'' into a single symlink.
179
180 To complete this example, Stow will also create the symlink
181 /usr/local/info pointing to stow/perl/info; the symlink /usr/local/lib
182 pointing to stow/perl/lib; and the symlink /usr/local/man pointing to
183 stow/perl/man.
184
185 Now suppose that instead of installing the Perl package into an empty
186 target tree, the target tree is not empty to begin with. Instead, it
187 contains several files and directories installed under a different sys‐
188 tem-administration philosophy. In particular, /usr/local/bin already
189 exists and is a directory, as are /usr/local/lib and
190 /usr/local/man/man1. In this case, Stow will descend into
191 /usr/local/bin and create symlinks to ../stow/perl/bin/perl and
192 ../stow/perl/bin/a2p (etc.), and it will descend into /usr/local/lib
193 and create the tree-folding symlink perl pointing to
194 ../stow/perl/lib/perl, and so on. As a rule, Stow only descends as far
195 as necessary into the target tree when it can create a tree-folding
196 symlink.
197
198 The time often comes when a tree-folding symlink has to be undone
199 because another package uses one or more of the folded subdirectories
200 in its installation image. This operation is called ``splitting open''
201 a folded tree. It involves removing the original symlink from the tar‐
202 get tree, creating a true directory in its place, and then populating
203 the new directory with symlinks to the newly-installed package and to
204 the old package that used the old symlink. For example, suppose that
205 after installing Perl into an empty /usr/local, we wish to install
206 Emacs. Emacs's installation image includes a bin directory containing
207 the emacs and etags executables, among others. Stow must make these
208 files appear to be installed in /usr/local/bin, but presently
209 /usr/local/bin is a symlink to stow/perl/bin. Stow therefore takes the
210 following steps: the symlink /usr/local/bin is deleted; the directory
211 /usr/local/bin is created; links are made from /usr/local/bin to
212 ../stow/emacs/bin/emacs and ../stow/emacs/bin/etags; and links are made
213 from /usr/local/bin to ../stow/perl/bin/perl and ../stow/perl/bin/a2p.
214
215 When splitting open a folded tree, Stow makes sure that the symlink it
216 is about to remove points inside a valid package in the current stow
217 directory. Stow will never delete anything that it doesn't own. Stow
218 ``owns'' everything living in the target tree that points into a pack‐
219 age in the stow directory. Anything Stow owns, it can recompute if
220 lost. Note that by this definition, Stow doesn't ``own'' anything in
221 the stow directory or in any of the packages.
222
223 If Stow needs to create a directory or a symlink in the target tree and
224 it cannot because that name is already in use and is not owned by Stow,
225 then a conflict has arisen. See ``Conflicts'' in the info manual.
226
228 When the `-D' option is given, the action of Stow is to delete a pack‐
229 age from the target tree. Note that Stow will not delete anything it
230 doesn't ``own''. Deleting a package does not mean removing it from the
231 stow directory or discarding the package tree.
232
233 To delete a package, Stow recursively scans the target tree, skipping
234 over the stow directory (since that is usually a subdirectory of the
235 target tree) and any other stow directories it encounters (see ``Multi‐
236 ple stow directories'' in the info manual). Any symlink it finds that
237 points into the package being deleted is removed. Any directory that
238 contained only symlinks to the package being deleted is removed. Any
239 directory that, after removing symlinks and empty subdirectories, con‐
240 tains only symlinks to a single other package, is considered to be a
241 previously ``folded'' tree that was ``split open.'' Stow will re-fold
242 the tree by removing the symlinks to the surviving package, removing
243 the directory, then linking the directory back to the surviving pack‐
244 age.
245
247 The info manual ``Stow 1.3.3: Managing the installation of software
248 packages'' by Bob Glickstein, Zanshin Software, Inc.
249
251 Please report bugs in Stow using the Debian bug tracking system.
252
253 Currently known bugs include:
254
255 * The empty-directory problem. If package FOO includes an empty
256 directory--say, FOO/BAR--then:
257
258 1. if no other package has a BAR subdirectory, everything's
259 fine.
260
261 2. if another stowed package, QUUX, has a BAR subdirectory,
262 then when stowing, TARGETDIR/BAR will be ``split open'' and the
263 contents of QUUX/BAR will be individually stowed. So far, so
264 good. But when unstowing QUUX, TARGETDIR/BAR will be removed,
265 even though FOO/BAR needs it to remain. A workaround for this
266 problem is to create a file in FOO/BAR as a placeholder. If you
267 name that file .placeholder, it will be easy to find and remove
268 such files when this bug is fixed.
269
270 * When using multiple stow directories (see ``Multiple stow direc‐
271 tories'' in the info manual), Stow fails to ``split open'' tree-
272 folding symlinks (see ``Installing packages'' in the info man‐
273 ual) that point into a stow directory which is not the one in
274 use by the current Stow command. Before failing, it should
275 search the target of the link to see whether any element of the
276 path contains a .stow file. If it finds one, it can ``learn''
277 about the cooperating stow directory to short-circuit the .stow
278 search the next time it encounters a tree-folding symlink.
279
281 This man page was constructed by Charles Briscoe-Smith from parts of
282 Stow's info manual. That manual contained the following notice, which,
283 as it says, applied to this manual page, too. The text of the section
284 entitled ``GNU General Public License'' can be found in the file
285 /usr/share/common-licenses/GPL on any Debian GNU/Linux system. If you
286 don't have access to a Debian system, or the GPL is not there, write to
287 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
288 MA, 02111-1307, USA.
289
290 Software and documentation Copyright (C) 1993, 1994, 1995, 1996
291 by Bob Glickstein <bobg+stow@zanshin.com>.
292
293 Permission is granted to make and distribute verbatim copies of
294 this manual provided the copyright notice and this permission
295 notice are preserved on all copies.
296
297 Permission is granted to copy and distribute modified versions
298 of this manual under the conditions for verbatim copying, pro‐
299 vided also that the section entitled ``GNU General Public
300 License'' is included with the modified manual, and provided
301 that the entire resulting derived work is distributed under the
302 terms of a permission notice identical to this one.
303
304 Permission is granted to copy and distribute translations of
305 this manual into another language, under the above conditions
306 for modified versions, except that this permission notice may be
307 stated in a translation approved by the Free Software Founda‐
308 tion.
309
310
311
312 28 March 1998 STOW(8)