Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Occasionally I am installing application with something other than apt-get or the Package Manager.

What is the "best practice" location for installing user apps? (/usr/bin/, /usr/local/bin/, /opt/, etc)

share|improve this question
Liking to install things from source every so often, I wrote a little tool to do it which does the changes to your shell startup file on its own (and also modify your library prefix, if you ask it, for programs that depend on shared libraries). Not very feature rich, but it works 99% of the time. – new123456 Apr 28 '13 at 0:57
Related post: – Lucio Aug 23 '15 at 3:23
Great discussion on the distinction between /opt and /usr/local : – blong Oct 26 '15 at 20:13
up vote 104 down vote accepted

That depends, really. If the application has a makefile, (for python apps) uses distutils (has a file) or a similar build/install system, put it into /usr/local/ (default behavior).

If you just need to extract a tarball and run directly (e.g. Thunderbird, Firefox) then put it into /opt/.

Why? From what I understand, /usr/local/ has a hierarchy that is similar to /usr/. So a program expecting to get "installed" into /usr/ should work fine in /usr/local/. A program that just needs one directory and will get all files/libraries relative to that directory can get one directory for itself in /opt/.

share|improve this answer
It seems so many people forget about opt/ - in my opinion you've hit the nail on the head as for it's purpose. – Marco Ceppi Aug 5 '10 at 15:23
I downloaded eclipse & extracted to /opt. How can I make it run from terminal as like other programs like javac,java. I did with update-alternatives as follows, sudo update-alternatives --install "/usr/bin/eclipse" "eclipse" "/opt/eclipse/eclipse" 1 BUT IT SAYS COMMAND NOT FOUND I TYPE sudo eclipse – Deepen Apr 28 '14 at 7:16
Make a symlink from /usr/bin or add it to PATH in ~/.bashrc – Alex Jun 25 '14 at 2:24

It's good to remember that /usr does not stand for user but rather unix system resources.

As such, I tend to figure that any distribution has the rights to stomp all over over contents of /usr, and that my specific additions to the system go in /usr/local, which I preserve before doing an upgrade.

Meanwhile, applications and other things go in /opt.

Some people feel comfortable putting stuff in /home, though I rarely follow that convention.

All that said, I let the distribution package manager do things its way first, and then do the above when hand rolling stuff.

share|improve this answer
It's worth remembering that 'unix system resources' is a renaming performed AFTER '/home' was added. In the old, old, old days (Unix Version 6 you would see directories like /usr/jimmy, /usr/siobhan, /usr/ahmed, etc. because the "user" directories were stored in /usr. – Mark Leighton Fisher Nov 20 '12 at 18:52
+1 for usr = "unix system resources" – ruuter Oct 18 '14 at 17:50
OK I'll bite: what does opt stand for? – Seth May 12 '15 at 2:17
@Seth I think it's 'optional' - it was originally for software that wasn't part of a default installation. – Carl H Jun 13 '15 at 14:53

Install unstable programs like firefox devel in /home/user/opt/ makes it a lot easier to remove, and no confusion for other users as to what version they should use... So if it is not a program for global use, install it in a subfolder in your home directory.

Never install programs in /usr/, it is likely to cause chaos, things installed in /usr/ is meant to be for distribution packages only. /usr/local/ is for packages locally compiled. And the srtucture works in exactly the same way! files in /usr/local/ will be prioritized over files in /usr/

/opt/ should be used for installation of pre-compiled (binary) packages (Thunderbird, Eclipse, Netbeans, IBM NetSphere, etc) and the like. But if they are only for a single user they should be put in your home directory.

If you want to be able to run a program installed in a "weird" location (like /home/user/opt/firefox/) without typing the whole path you need to add it to your $PATH variable, you can do this be adding a line like this in your /home/user/.profile

export PATH=/home/user/opt/firefox:$PATH

The folder name should be the one where the executable file you need to run is located.

share|improve this answer

The Linux Filesystem Hierarchy Standard indicates /usr/local

"The original idea behind '/usr/local' was to have a separate ('local') '/usr' directory on every machine besides '/usr', which might be just mounted read-only from somewhere else. It copies the structure of '/usr'. These days, '/usr/local' is widely regarded as a good place in which to keep self-compiled or third-party programs. The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr. Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr."

share|improve this answer

I usually have a folder named "Programs" in my home where I install those programs, strange enough (or not) they are all java stuff right now.

It has one great advantage for me, when I reinstall or change computers they get moved with the rest of my home. It has a clear disadvantage, those apps are only available to my user.

share|improve this answer

Use "checkinstall" to convert your alien package to a deb so that it is uninstallable using the package manager.

Do note that config files will often not be handled as config files (perhaps ignored, or perhaps treated as part of the app), and that pre- and post-install scripts sometimes get bungled, though it will usually warn you when it thinks the deb will have a bad pre- or post-install script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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