Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Packages installed with synaptic are usually well installed on your system (i.e. bin in /usr/bin/, etc.). However, when a software is not in the repo, I always wonder where I should install it, when everything comes together (i.e. /bin, /var, /man are all subfolders of the main folder of the software).

For now, I've opted for /var/opt/ or /usr/share, but I'm not really sure this is a best practice... is there any guidelines on that?

share|improve this question

migrated from stackoverflow.com Jun 24 '11 at 8:53

This question came from our site for professional and enthusiast programmers.

5 Answers 5

The usual location us /usr/local or /opt. From the Linux Directory Hierarchy:

/usr/local, /opt

These are obsolete folders. When UNIX didn't have a package system (like RPM), sysadmins needed to separate an optional (or local) Software from the main OS. These were the directories used for that.

share|improve this answer

/usr/local is intended for this

Have a look at checkinstall: https://help.ubuntu.com/community/CheckInstall

sudo checkinstall make install

It will create (and subsequently) install a .deb package, so you can do a clean removal, or install the same package easily and quickly on other machines (of the same architecture)

share|improve this answer

/usr/local/ is my favorite.

You might like to skim the FHS -- keeping in mind that it is a bit dated, and it was never proscriptive, instead descriptive of common practice. That said, it's still worth a read.

/opt/ is another common choice. I don't like it. It feels funny. You might find it fine. /var/opt/ feels outright wrong -- /var/ is a home for data, not binaries.

share|improve this answer

There actually is a (more or less) authoritative guideline where to place files on Linux systems: the File Hierarchy Standard (FHS).

I'd either place the files in /opt or in /usr/local.

share|improve this answer
    
And man hier of course. –  vtest Jun 24 '11 at 8:57
    
hier(7) is just a very abbreviated version of the FHS. –  joschi Jun 24 '11 at 9:30

/usr/local for binaries plus /var/local for data is a fine choice. The basic reasoning is that everything in /usr is handled by your distribution (i.e. may get removed or overwritten), while everything in /usr/local is handled by yourself. Apart from that the two hierarchies are nicely parallel (e.g. you have /usr/include and /usr/local/include etc.), so it's fairly intuitive to navigate.

If you're using autotools, ./configure --prefix=/usr/local will often give the desired result right out of the box.

share|improve this answer

Your Answer

 
discard

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