Managing Software Packages With GNU Stow
Presented by David Lee Ludwig
to the Worcester Linux User's Group
July 19th, 2000
What is GNU Stow?
- Manages the installation of non-prepackaged software.
- When installing from source
- When installing binaries.
- When packages (.rpm, .deb, etc.) aren't available.
- Or when packages aren't recent enough.
How does it work?
- Places each "package" into its own subdirectory.
- Examples:
- Xemacs: /usr/local/stow/xemacs-21.1.20
- gnome-core: /usr/local/stow/gnome-core-1.2.0
- Each package has their own sub-directories.
- Examples:
- /usr/local/stow/gnome-core-1.2.0/bin
- /usr/local/stow/gnome-core-1.2.0/lib
- /usr/local/stow/gnome-core-1.2.0/share
How does it work?
- Each "package" has its contents symlinked into another directory (the "target directory")
- Examples: (target directory = "/usr/local")
- /usr/local/stow/dia_0.85/bin/dia -> /usr/local/bin/dia
- /usr/local/stow/dia_0.85/share/dia/dia_logo.png -> /usr/local/share/dia/dia_logo.png
- /usr/local/stow/dia_0.85/man/man1/dia.1 -> /usr/local/man/man1/dia.1
- And so on...
Important notes...
- Stow isn't as easy to use as other methods of software management (such as rpm, dpkg, etc.)
- Who should use/consider stow:
- People confortable with installing from source (./configure; make; make install)
- People wanting to better organize their software.
- Who shouldn't use/consider stow:
Calling Stow
- Command-line based.
- Usage: stow [options] package_name
- Features include: (more to follow)
- Adding/installing...
- Deleting/uninstalling...
- Note: Before calling stow, each package must be pre-installed to it's own directory...
Pre-Installing Packages
- "From source" installations are the most common use of stow.
- Most common 'from source' method (with configure scripts):
- The process of building software changes to:
- ./configure
- make
- make install prefix="/usr/local/stow/package-name_version"
- Examples:
- make install prefix="/usr/local/stow/dia_0.85"
- make install prefix="/usr/local/stow/WindowMaker_0.62.1"
Pre-Installing Packages
- Less common 'from source' method (no configure scripts)
- Pre-installation varies from package to package
- In some cases: make; make install prefix="/usr/local/stow/package_version"
- In some other cases: Editing the Makefile might be necessary.
- That's one reason why stow isn't for first time Linux users.
- Alternative (for configure-scriptless packages): simply don't use stow.
Installing Packages
- Usage: stow package_directory
- Stow will take all the files in "package_directory" and symlink them into the current directory's parent directory (which is called the "target directory".)
- Example:
- For a package installed into: /usr/local/stow/dia_0.85
- cd /usr/local/stow
- stow dia_0.85
- All files in /usr/local/stow/dia_0.85 are symlinked into /usr/local.
Installing Packages
- Alternate method of installing a package:
- Method one: stow -t target_directory package_name
- Example:
- cd /usr/local/stow
- stow -t /usr dia_0.85
- This will install the package "dia_0.85" into /usr (instead of /usr/local).
Uninstalling Packages
- The commands are similar to installing packages.
- Usage: stow -D package_name
- Example:
- Cd /usr/local/stow
- stow -D dia_0.85
- Example, if the target directory is "/usr" (that is, the package was installed with "stow -t /usr dia_0.85", as specified in the previous slide.)
- cd /usr/local/stow
- stow -D -t /usr dia_0.85
Finally...
- The GNU Stow homepage: http://www.gnu.org/software/stow
- Download at:
- Tarballs (.tar.gz) available at ftp://ftp.gnu.org/gnu/stow
- RPM packages available at http://rpmfind.net
- Debian installation via "apt-get install stow"