Home » Questions » Computers [ Ask a new question ]

What is the conventional install location for applications in Linux?

What is the conventional install location for applications in Linux?

I'm currently installing NetBeans, and the default install directory is /home/thomasowens/netbeans-6.8. I'm not a fan of that location, so I'm looking at /etc, /bin, /usr/bin, and /sbin. Does Linux have a place that, by convention, is the same as Windows' C:\Program Files directory?

Asked by: Guest | Views: 380
Total answers/comments: 4
Guest [Entry]

"According to the Filesystem Hierarchy Standard, there are several places that are acceptable, depending on the application. I'm quoting from it extensively here.

bin is short for ""binary"" of course
sbin is short for ""server binary"", otherwise defined as:

Utilities used for system
administration (and other root-only
commands)

/usr is for shareable, read-only data, and should be shareable between various FHS-compliant hosts (if you have lots of machines on your network, and they're all the same architecture, you should be able to share a single /usr folder with every machine on the network)
/usr/local is for use by the system administrator when installing software locally (ie, for applications installed only on this machine, not on every machine on the network).

Taking these together:

/usr/bin is the primary directory of executable commands on the system.
/usr/sbin is for any non-essential binaries used exclusively by the system administrator.
System administration programs that are required for system repair, system recovery, mounting /usr, or other essential functions must be placed in /sbin instead (ie, the things you need to access in order to mount /usr/sbin go in /sbin)
Likewise, essential user commands that may be needed before /usr is mounted go in /bin
Anything installed only on the local machine should go in /usr/local/bin or /usr/local/sbin

There's one other use for /usr/local though. Most things that you install through your distro's package manager will be placed under /usr; many people put things they've compiled by hand under /usr/local instead. This keeps them out of the way of the package management system and lets you spot what you installed from the distro (and don't need to back up because you can grab it again) and what you compiled by hand; it also lets you run different versions at the same time (eg, /usr/bin/firefox vs /usr/local/bin/firefox).

Just when you thought things were settled, there's one other place, which is probably the closest equivalent of c:\Program Files - /opt:

/opt is reserved for the installation of add-on application software packages.`

/opt is probably the closest equivalent to c:\program files, in that it's the one place you'd expect to find an application with all its files together in one folder, rather than scattered across /usr/bin, /var, and /etc. It's usually only used by very large packages, but in this case, given that Netbeans wants to have its own folder, it probably makes the most sense to put it under /opt/netbeans"
Guest [Entry]

"While the Filesystem Hierarchy Standard does provide some guidance. I've found that most distributions like to install packages into /usr/share.

Because of this, I've adopted the practice of installing any application not installed via package manager (rpm / apt-get / emerge) in /usr/local. This allows me to keep applications and libraries that aren't managed via package management separate from those that are.

It's a technique that has helped me manage my system under both Fedora Core and Gentoo."
Guest [Entry]

Agreeing with James Polley's answer, but in fact the default directory makes a lot of sense unless you need to share the application between multiple accounts. I, for instance, needed to install Eclipse 3.0 (obsolete) in order to do Flex work under Linux, and I put it in $HOME/eclipse3.
Guest [Entry]

"I like to use /apps for most add-on apps that I install on multiple servers. I keep a copy of the folder in /installs/apps on my nfs server. When I create any new linux server I mount the installs folder and copy /apps and I have many different common apps on the new server. I delete those entries I don't need for this new server and I'm done. Well, maybe I need to run a script or three for setting environment variables or path statements but that's pretty much what it takes to set up many new servers.

I come from a Windows and .net background. One of the promises of .net was that most apps could be installed by using Windows xcopy. I look for the same thing in Linux. Where available, I choose the tarball over the RPM or yum, etc. so I can deploy to /apps with cp -r and add the app to my nfs server for future deployments."