Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by dv3500ea, txwikinger Oct 28 '10 at 0:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
to add ~/bin to $PATH, you can add the following line in your ~/.bashrc file PATH=$PATH:$HOME/bin –  nathwill Oct 27 '10 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. –  ImaginaryRobots Oct 27 '10 at 19:39

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

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.