views:

298

answers:

5

As a developer, I've often downloaded and run

./configure
./make
./make install

to install apps onto my Linux system. But I've never been quite clear on the best place to keep the downloaded directory. My local Desktop is the default location, but I'd like to know what the best "official" place to keep it is. Also, does it vary by distro?

I'm running Ubuntu for now. I know apt-get install can do this for you, but sometimes the app I'm interested in simply isn't available on those lists.

+7  A: 

Perhaps "/usr/local/src" ? ;-)

Steel Plume
+13  A: 

Take a look at the FileSystem Hierarchy Standard: it's /usr/local/src. However, this is a contentious issue as you will find here.

dirkgently
Thanks for the links. I've never been clear on just where to put these, and that helps to put things in perspective.
Jack BeNimble
+2  A: 

If you use a package manager, allow it to use the default for managed packages. If you administer the box, put unmanaged third party tools under /usr/local as Steel Plume suggests (though there are some who prefer /opt). If installing as a unprivileged user, unpack and compile in $(HOME)/src, and install into $(HOME)/bin, $(HOME)/etc, and so on.

dmckee
I asked this question a couple of years ago on some other forum when developing a Python app on a Linux box. I knew about the standard linked to by dirkgently, but I went with /opt. Nobody communicated to me that this was necessarily a bad idea.
George Jempty
I wouldn't call it bad. Just unusual. The best argument *for* /opt that I know, it that it can be mounted without first mounting /usr. This is a small but real bonus. However, /usr/local has a *long* history.
dmckee
A: 

@dirkgently and @dmckee are completely spot on. I would add that since it is can be a contentious issue, I would mimic what the distribution provider (in your case) Ubuntu does for its major packages.

ezrock
A: 

for personal use: ~/src

for sharing across a system: /usr/local/src

Andrew Hodgson