• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Directory to install software

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a newbie to unix. Do you know what directory should I use to install new software? I've seen people installing software in all kind of different places such as

/usr/local
/users
/usr
...etc.

I know you can install software anywhere you want but I just want to know what is the correct unix location to install software. Thanks
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It varies by distribution, and by personal preference.

I tend to use /opt

There have periodically been attempts to have standards in the Linux world, but since its open source, anyone is free to decide they don't like the standard and do it some other way.

The key thing is to put them someplace that will stay there if you reinstall the OS. But with modern package managers, this is much less of an issue.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This page has a good explanation: http://www.pathname.com/fhs/pub/fhs-2.3.html
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The great thing about standards is that there are so many to choose from. (Daniel McCracken, I think).

There's 3, no 4, primary places programs end up. It's largely personal preference, but I have some guidelines I use. For whatever it's worth, here there are:

For a complete self-contained vendor environment, there's /opt. /opt is sometimes subdivided by product within vendor, as for example IBM and Websphere.

For a traditional approach, there's the /usr/local tree. A lot of Unix-style packages would build and install their packages into a subdirectory named for the package under /usr/local. I often put Tomcat and Ant there.

For really pervasive stuff, you can install directly into the /usr/bin and related directories. This is best done via the system's package manager (rpm, debian package manager, Solaris dpkg, etc.).

There's also the blended approach, where you install everything in one directory (/opt or /usr/local) and then softlink to present its system characteristics in their familiar locations; config stuff in /etc, logs in /var/log, workfiles in /var/lib and so forth.

The fourth approach is seen for applications that have a particular runtime environment such as Python or Perl. In this case, the packages normally install into a /usr/lib/<language> directory, such as /usr/lib/perl/site_perl.

CAUTION: according to the strict definition of the FHS, /usr should be read-only. Packages that have volatile storage requirements such as work directories, session info, etc. should assign those items elsewhere (normally under /var/lib).
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know about which Unix variant you're talking, but if it's Linux: Most Linux distributions have a package management system. The two most used systems are RPM (Red Hat Package Manager) and DEB (from Debian). The package manager takes care of installing, keeping track of, and removing software on your system. You download an .rpm or a .deb file and use the package manager to install it. The package manager will put all the necessary files in the right place for the program to work. If you later remove a package, it will clean up everything neatly.

Most programs installed via the package manager will put files in /usr/bin, /usr/lib, /etc and other places.

Sometimes you want to download the source code of a program which is not in an RPM or DEB package. Most of these things come with a makefile, and you use the program "make" to compile and link the program from source code. GNU software uses a certain convention for makefiles, and so the makefile of GNU programs and many other pieces of software comes with a standard set of make targets. You can usually build these programs with the following commands:

If the program is built successfully, you can usually install it with:

(you must run this last command as the root user, or with sudo if your Linux distribution uses sudo). This will normally install the program into /usr/local.

On my Ubuntu system, I always put manually installed programs in /usr/local.
 
Pat Farrell
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jesper Young:
I don't know about which Unix variant you're talking, but if it's Linux:



There was Unix before Linus. And nearly all of the *nix had their own special feature that was better than all the rest. AIX, HPux, DG's, System V, System 7, etc. all seemed to do it their own.

But as Jesper says, if you are using Linux, use the built in tools.
apt-get or synaptic on debian, rpm or urpmi on RedHat family members.
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I highly recommend packages. However, some of the best apps were designed for other times or other Unices (such as BSD), so occasionally you'll end up with the old "configure/make/make install" process or one of its kindred. Mostly these install to /usr/local, although some of the specialized ones such as "perl Makefile.pl/make" go to other places, as I mentioned above.
 
reply
    Bookmark Topic Watch Topic
  • New Topic