0

Possible Duplicate:
'Installing' Applications, where to put folders?

Hello,

Where shall I put applications which do not require install (extracted from archive)?

E.g.

  1. java based programs
  2. executable scripts

In two variants:

  • for all users
  • for one user

Some times the archive itself contains directories like lib or bin.

For example, apps like ArgoUML

Shall I put all the apps in /usr/local/appname?

0

2 Answers 2

5

I keep a growing collection of my own programs (nearly all self-contained shell and Python scripts) in ~/bin. (Some are actually symlinks to scripts located elsewhere.)

I similarly use ~/site for programs installed in my $HOME (usually through "./configure --prefix=$HOME/site; make; make install"); that is, they're only available for a single user. These applications use the traditional bin, lib, etc. directories (~/site/bin, ~/site/lib, etc.).

System-wide programs need to be installed in /usr/local/. So if you have a single executable file, you can drop it in /usr/local/bin. If an archive has its own bin, lib, etc., those go in /usr/local/bin, /usr/local/lib, etc.

The traditional way is to "mix" applications together, with all commands in bin, all libraries in lib, and so forth. This is painful to uninstall, but requires no further settings for $PATH, manpages, shared resources, etc. If you want a completely separate application, you can put it in /opt as /opt/appname. You'll need to configure /opt/appname/bin to be in the $PATH (or specify the full path to execute it).

With all of these options that don't use a configure command, the program needs to already know how to find its libraries (often through a linker RPATH setting, but there are other ways). I would usually not attempt to modify a program if it can't do this already; and certainly wouldn't recommend it for most users.

2
  • to add ~/bin to $PATH, you can add the following line in your ~/.bashrc file PATH=$PATH:$HOME/bin
    – nathwill
    Oct 27, 2010 at 18:11
  • I prefer to put the user-specific files at ~/local instead of ~/site, (allows for ~/local/src, ~/local/lib and so on), but otherwise agree with your reasoning and locations. Oct 27, 2010 at 19:39
0

I would suggest placing anything you download and run yourself in the /opt directory. For example with my eclipse build. I extract it in /opt/eclipse now I create a symbolic link and reference it around my system that way. It allows me to change versions and all my programs stay current and no messy rewrite of paths when i update.

Goodluck

how to create symbolic link:

ln -s linkname /path/to/link

Not the answer you're looking for? Browse other questions tagged .