Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Linux Software

Manage Packages Using Stow 234

dW writes "This article is about Stow, a software installation management utility for Linux that offers a number of advantages over the tried-and-true Red Hat and Debian package management systems. With Stow, you can package applications in standard tar files and keep application binaries logically arranged for easy access."
This discussion has been archived. No new comments can be posted.

Manage Packages Using Stow

Comments Filter:
  • by dkf ( 304284 ) <donal.k.fellows@manchester.ac.uk> on Wednesday March 12, 2003 @09:15AM (#5492931) Homepage
    We (the Tcl core developers) have had problems in the past with Stow, mainly because it relies on being able to specify the installation process at 'make-install' time instead of normal 'make' time, leading to messed up baked-in paths... :^/
  • well... (Score:5, Informative)

    by virtual_mps ( 62997 ) on Wednesday March 12, 2003 @09:17AM (#5492938)
    stow is not at all a "package management utility for linux". It's a perl script and runs on almost anything. I've used it to manage local packages on IRIX, Solaris, and various flavors of Linux. IMO, the great strength of stow is exactly local packages--it's a great way to manage a shared /usr/local or such. I suggest thinking of stow as a powerful complement to your native package management scheme.
  • by Anonymous Coward on Wednesday March 12, 2003 @09:18AM (#5492948)
    try encap. predates stow.

    http://encap.cso.uiuc.edu
  • by virtual_mps ( 62997 ) on Wednesday March 12, 2003 @09:28AM (#5492995)
    We (the Tcl core developers) have had problems in the past with Stow, mainly because it relies on being able to specify the installation process at 'make-install' time instead of normal 'make' time, leading to messed up baked-in paths...


    I'm not exactly sure what you're unhappy with, but it sounds like a build problem rather than a stow problem, IMHO. With stow you can build the program to expect either the "real" path, or the "stowed" path, depending on your purposes. (Using the "real" path means that multiple versions can be installed in the stow tree and used simultaneously with an explicit path, while using the "stowed" path means that things like config files are in an expected location like "/usr/local/etc".)
  • Rather Amiga assigns (Score:1, Informative)

    by Anonymous Coward on Wednesday March 12, 2003 @09:29AM (#5493008)
    Stow is a symlink-kludge.

    Much nicer to add amiga-style assigns to the filesystem.

    Assigns are like PATH env-vars, but part of the filesystem.

  • by virtual_mps ( 62997 ) on Wednesday March 12, 2003 @09:31AM (#5493022)
    The article does not mention anything about dependencies. In my opinion dependencies are almost as important as keeping track of which file belongs to what application.


    Stow doesn't do dependencies. IMO, that's fine for local package management, where dependency handling is often more trouble than it's worth. (A local package will typically be run on a know configuration, and can target that configuration.)

    Maybe they should do some more homework and take a look at Gentoo's Portagepackaging system.


    Do some homework? You are aware that stow has been around since 1996, right? It's amazing how many gentoo fanboys don't know what else is out there.
  • by Anonymous Coward on Wednesday March 12, 2003 @09:35AM (#5493036)
    I have more faith in GNU Autopackage [autopackage.org] myself.
  • by cyb97 ( 520582 ) <cyb97@noxtension.com> on Wednesday March 12, 2003 @09:38AM (#5493049) Homepage Journal
    Or as everybody else refers to it... ~
  • Encap is better (Score:4, Informative)

    by tskirvin ( 125859 ) on Wednesday March 12, 2003 @09:39AM (#5493053) Homepage
    encap [uiuc.edu] is a better and more established system that works on the same general idea - put everything in /usr/local/encap/PACKAGE-VERSION, and symlink into place. It's mostly just used at UIUC, but good Gods it works well. I use it for absolutely everything, and essentially refuse to install anything on our systems that won't support it. And I have yet to encounter a workplace where it doesn't win over absolutely everyone with its simplicity within six months.

    Also, cpanencap [uiuc.edu] is the perfect tool for perfecting Perl's module system. All it needed was versioning.
  • It doesn't (Score:3, Informative)

    by ggeens ( 53767 ) <ggeens AT iggyland DOT com> on Wednesday March 12, 2003 @09:41AM (#5493068) Homepage Journal

    Stow has no concept of dependencies. There is no way you could use it to build a distribution on top of it.

    I use stow on my (Debian) Linux PC at home, to manage the software I build from source. If I want to upgrade a program, I can just delete the directory and install the new version in the same location. If a Debian packages becomes available, I remove the directory and have stow remove the links in /usr/local/*.

    Until now, I have been able to get all the libraries from Debian, so I never needed to work with dependencies.

  • by Anonymous Coward on Wednesday March 12, 2003 @09:41AM (#5493069)

    Stow does not handle dependencies. All it does is use symbolic links so that your packages may install in one directory (completely) and then have symbolic links to a shared directory tree. This was once a standard technique that was manually performed by several system administrators. More recently packaging systems have gained widespread acceptance by people so tools like stow have not been as amazingly handy.

    Stow still has importance, though. For example, some people would prefer to build their own application distribution area. This is of particular utility when you have a network of machines and want the same applications available everywhere. Pick a machine and have it NFS share the applications. In these situations Stow still is important. Maybe the stock packaged Perl is not good enough, maybe you want the multithreaded options and a few extra modules from CPAN. Then creating a new Perl directory and stowing it somewhere else is handy.

    Stow is not perfect. I have found that it is a bit buggy with its delete operation. I usually erase the directory with the given software and then look for symbolic links that are broken:

    ls -lL > /dev/null 2> /tmp/T
    rm `sed s/:.*$//g`

  • by aagren ( 25051 ) on Wednesday March 12, 2003 @09:42AM (#5493078)
    I've used stow on different unix platforms during the last couple of years, and I think it is a great tool to maintain software packages which aren't supported by the platforms own packaging system (deb, rpm, pkg, etc..)

    But remember one thing. If you are starting with a new stow system in f.x. /usr/local, then be sure to make the directory structure:

    /usr/local/bin
    /usr/local/lib
    /usr/local/include
    etc

    if it doesn't exit before stowing anything. Otherwise the following will happen. let's asume that you have the software package in: /usr/local/packages/app-1.4

    with it's own strucure like: /usr/local/packages/app-1.4/bin /usr/local/packages/app-1.4/lib
    etc.

    stow'ing this packages without the /usr/local-structure will result in:

    ls -l /usr/local

    bin -> packages/app-1.4/bin
    lib -> packages/app-1.4/lib
    etc.

    Then the nect package (let's call it app2-1.5) you will be stow'ing to /usr/local wille see that f.x. /usr/local/bin allready exits at then link the files from it's own bin-drectory to /usr/local/bin, which result in files from app2-1.5 will be linked to the /usr/local/packages/app-1.4 structure, which will mess up things.
  • by Imran ( 4369 ) on Wednesday March 12, 2003 @09:46AM (#5493105)
    Flamebait disclaimer: I have been running Gentoo on all of my machines for over a year now, so don't take this as an anti-Gentoo comment.

    stow and ebuilds aren't really operating in the same space.

    rpm,deb,portage = full blown package managers, controlling everything under /usr. These can start with source (or pre-compiled binaries), and handle everything from installation to dependency-handling, etc (with varying degrees of efficiency).

    stow = simple symlink manager, providing an easy way to maintain order within /usr/local, for those apps I compile and install manually (and, for whatever reason, don't want to repackage as an ebuild/rpm/whatever)

    There are times when one does create one's own ebuilds (v simple) or rpms (slightly more involved). For all other occasions, stow is a helpful tool :)
  • by virtual_mps ( 62997 ) on Wednesday March 12, 2003 @09:53AM (#5493145)
    Then the nect package (let's call it app2-1.5) you will be stow'ing to /usr/local wille see that f.x. /usr/local/bin allready exits at then link the files from it's own bin-drectory to /usr/local/bin, which result in files from app2-1.5 will be linked to the /usr/local/packages/app-1.4 structure, which will mess up things.


    Odd. On my system it will notice that bin is a symlink to a bin dir in a different stow package, remove the symlink, create a dir, then link the contents of *both* packages bin dirs into the new /usr/local/bin.
  • by dolmen.fr ( 583400 ) on Wednesday March 12, 2003 @10:00AM (#5493187) Homepage
    For french guys, there is a Stow tutorial in GNU Linux Magazine France of this month (http://www.linuxmag-france.org/). The article is not available online.

    Here is the author web site : http://hocwp.free.fr/ln_local/index.html
    However I don't recommend his ln_local tool (a simple stow replacement) as it is seriously flawed: this shell script doesn't escape spaces (and other more dangerous shell chars) in filenames when handling them.

    Stow is here : http://www.gnu.org/software/stow/stow.html
    See also XStow : http://xstow.sourceforge.net/

    Dolmen.
  • by wct ( 45593 ) on Wednesday March 12, 2003 @10:25AM (#5493359)

    Checkinstall [izto.org] automatically produces native packages (rpm, deb, slackware tgz) from a standard make install. I've found this gives the best of both worlds - easy, consistent package management coupled with flexible/optimized source configuration.

  • by schweikert ( 21009 ) on Wednesday March 12, 2003 @10:42AM (#5493513) Homepage
    SEPP [ee.ethz.ch] is a package management system that allows to separate packages in directories like Stow and similar, but in addition:
    • solves the distribution problem by allowing to mount packages with NFS and using the automounter to make the applications available under a standard path (/usr/pack/PACKAGE)
    • provides for each application a wrapper script that takes care of all the necessary environment setup so that users don't need to edit their bashrc
    • supports installation of multiple versions of the same application by installing version-tagged binaries in addition to the normal binaries. I can for example run mozilla-1.1 or just mozilla, in which case I get the "default" version. This is very important for example for a Ph.D. student that wants to finish his thesis with Matlab 5.3.
    • automatic generation of web documentation (have a look here [ee.ethz.ch])
    • usage logging with syslog
    • dependencies
  • by Niggle ( 68950 ) on Wednesday March 12, 2003 @10:53AM (#5493602) Homepage
    In windows, I double-click setup.exe, a GUI pops up, I pick the destination and off it goes.

    In Mandrake, I single-click an RPM and the package manager start installing it. Is that easy enough?

    Some notes on Windows and Linux package/program installation:

    1) Windows setups handle dependancies by basically not handling them. They almost always include a bunch of system DLLs and OCXs that might not be on a user's system or which might be outdated. This obviously leads to much larger packages which for a large part contain stuff that is already on the system. It would be relatively easy on Linux to make every package include every package it depends on. These don't have to be statically linked, you could include the packages for the shared libraries within the main package and have these install automatically. I think the bloat problem would be worse on Linux than Windows, because my feeling is that open source programs tend to use a much wider variety of shared libraries than their proprietary equivalents (where everybody re-invents the wheel on a daily basis because they can't use somebody else's design).

    2) Different languages are handled in many cases on Windows by having several setup programs. The main setup.exe in these cases is just a shell that selects which one to run. This adds to package bloat. Linux fares slightly better on this, because (IMHO) i18n is easier on the programmer here.

    3) Windows only needs to consider one architecture. If it had several to worry about, we'd probably see a situation much like we have with languages.

    4) Configuration at install time on Windows is mostly just choosing which optional extras to install. Most configuration is done within the program itself. This is more-or-less true on Linux as well (for desktop programs at least).

    To get close to the Windows installation experience under Linux, what we need to do would be to make every package include every sub-package it depends on and sub-packages for every architecture, disro and langauge. Then you could just download the single file, click it and get everything installed. That package would be enormous however.

    Tools like apt-get and urpmi give a very similar experience without the overhead of downloading a bunch of stuff you already have. So long as you stick with stuff that is packaged for you distro, they are painless.
  • Re:Excuse me? (Score:3, Informative)

    by Urban Garlic ( 447282 ) on Wednesday March 12, 2003 @11:35AM (#5493970)
    > Could somebody please enlighten me? I don't get the point at all.

    I'll try to give it a go. I have several Debian boxes, and mostly use apt, but every now and then I need to install something for which there is no .deb, and stow is perfect for that. I have an m68k cross-compiler version of gcc (for Palm(tm) development), a locally modified version of the GTK canvas, and a few other obscure, specialized bits of software, all of which are "stow"-ed. I have realized many of the advantages described in the article -- I can uninstall these things cleanly, and move between versions just by unstowing the old one and stowing the new one.

    I do think the article (and much of the commentary here) overstates the role of stow. It's not a substitute for a package manager, and the way it works makes it unsuitable for system-level software that, for instance, might need to set up cron jobs, require scripts in /etc/init.d, or be configured from a file in the /etc directory. But it *is* very useful for those occasional, obscure bits of software which primarily consist of libraries and include-headers, or non-system executables.

    Stow itself is not new, and interestingly is packaged by debian -- I got it by "apt-get install stow"...
  • by supergiovane ( 606385 ) <<arturo.digioia> <at> <ing.unitn.it>> on Wednesday March 12, 2003 @11:39AM (#5494012)
    To be more general, an ebuild is a file containing the description of the operations needed to have an app installed.

    1) It checks dependancies. If dependancies are satisfied it goes to step 2, else it launches the installation of needed packages.

    2) It retrieves the app (either sources or binary package, in any format). Some times the portage system simply cannot automatically retrieve the app through the network (apps with required registration or license agreement acceptance requirement). In this case it stops asking the user to manually retrieve the package files, then it continues with the installation.

    3) It prepares the app for installation (compiling sources or simply extracting in a temp dir the precompiled binaries (obviously it can deal with every package format)).

    4) It installs the app, updating config files.

    This way of working simply separates the actual app (source or any other package) from the metadata (contained in the ebuild script). So Gentoo can handle a lot of packets written for other distros (acting as a wrapper), simply trashing the original metadata and substituting it with its own. As a matter of fact writing an ebuild is easier than packaging an rpm.

  • by TheOrquithVagrant ( 582340 ) on Wednesday March 12, 2003 @12:15PM (#5494376)
    I'd say it's definitely just familiarity.

    For anyone confused about the "what goes where" in a Linux system, I warmly recommend taking a look at:

    http://www.pathname.com/fhs/

    which describes the Filesystem Hierarchy Standard, part of the Linux Standards Base. It should clear things up.
  • Stow is great! (Score:2, Informative)

    by __david__ ( 45671 ) on Wednesday March 12, 2003 @02:18PM (#5495442) Homepage
    I've been using stow for years. I use it on RedHat, Debian, Solaris, and Mac OS X. It's just a perl script so it is very cross-platform.

    One thing I noticed is that the author of this aritcle installed stow into /usr/local/stow/stow but then didn't stow it. He says:
    2. After installing Stow, add the absolute path to the stow directory to the $PATH variable.
    I always stow stow itself so that I don't have to mess with paths. Most every OS already points to /usr/local/bin. This line will bootstrap stow:
    /usr/local/stow/stow/bin/stow -d /usr/local/stow stow
    Despite the authors implication, stow isn't meant to be compared to rpms or .debs. It's a tool for managing your /usr/local heirarchy. And it's very good at that.

    The one thing to look out for with stow is "make install" on various packages. I learned to ALWAYS "make -n install" because a lot of packages are broken and don't install into the "prefix". That is, even thought you "configure --prefix=/usr/local/stow/xxxx" the dumb package will still try to put things in /usr/bin or /usr/local/bin or some other hardwired path. I've had to clean up numerous braindead makefiles.

    The greatest part of stow is not the installation, it's the deletion. Before I knew about stow, I didn't ever attempt to delete anything in /usr/local. When you look at a random file, it's impossible to tell where it came from! With stow it's a symbolic link so you can tell who "owns" it, and with stow -D, you can remove whole packages at a time. I've used it for installing new compilers: I have 2 gccs in /usr/local/stow/gcc-arm-elf-2.95 and /usr/local/stow/gcc-arm-elf-3.0.

    This:


    stow -d /usr/local/stow -D gcc-arm-elf-2.95
    stow -d /usr/local/stow gcc-arm-elf-3.0


    Will switch from the old compiler to the new compiler. It's just as easy to switch back to the old compiler if you need to.

    Ah. I love stow!

    -David
  • by volkerdi ( 9854 ) on Wednesday March 12, 2003 @04:10PM (#5496517)
    Because checkinstall uses tar+gz instead of Slackware's package building tool (makepkg), it produces broken Slackware packages. It should be fixed to use makepkg -- then I'd actually recommend it.

    Slackware packages are not simply tar+gz. It's important that the files are stored into the tar archive in a certain way, the correct version of tar is used, and the symbolic links are moved into the installation script properly, otherwise the package can't be effectively managed. You wouldn't try to make an rpm or deb with tar/cpio/bzip2/gzip/etc, so why people think they can tar up some files and call it a Slackware package is beyond me.
  • by shellbeach ( 610559 ) on Wednesday March 12, 2003 @07:00PM (#5498764)
    We (the Tcl core developers) have had problems in the past with Stow, mainly because it relies on being able to specify the installation process at 'make-install' time instead of normal 'make' time, leading to messed up baked-in paths... :^/

    Yes, but that's only a problem with the stow documentation. Use "--prefix=" during configure and you'll have no worries at all (except that the "baked-in" package names will be '/usr/local/stow/yourpackage/etc ...', but that has never mattered to me and I have about fifty stow packages installed on my system, with everything from gtk-2.2 to lyx to rxvt).

    I have used stow for the past year and absolutely love it. It allows me to have complete control over all the software I compile by had, as opposed to the base system installed by my distro. And since I have a bash alias to ./configure to include an automatic prefix assignment based on the directory name I'm configuring from (which is almost always based on the name and version number of the software), I can compile a new version and

    stow -D /usr/local/stow/foo-1.2

    stow /usr/local/stow/foo-1.3

    ... without losing my old version that I know works. (so, if my new version segfaults, I can "install" the old one simply by reversing the above process)

    And ... I can do a simple "du" command in the /usr/local/stow directory to see exactly how much disk-space each package is using and I can easily find, modify or delete a part of a package I compiled months ago!

    Stow is one of the most fantastic pieces of software, and it's simplicity itself as well. It reports conflicts and only installs sym-links. The scary thing is that this is the first and only time I have ever seen it reach "mainstream" coverage - like most of the best linux software, it seems to be unheard of and unused.

  • by volkerdi ( 9854 ) on Wednesday March 12, 2003 @08:26PM (#5499319)
    The fork of makepkg used in checkinstall produces broken packages, because it uses the wrong version of tar. This packs files differently, and it DOES make a difference.

    As soon as checkinstall uses Slackware's native makepkg by default on Slackware I'll be inclined to recommend it. Still, it's misleading to users of other versions of Linux who might think they are building correct Slackware packages and aren't. I did commit one patch to installpkg to detect and correct for the most common problem with non-standard packages, but can't correct for them all.

    Pat

There are two ways to write error-free programs; only the third one works.

Working...