Jack BeNimble
Jack BeNimble

Reputation: 36653

Where is source code for a Linux/Unix application most appropriately kept?

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.

Upvotes: 6

Views: 4995

Answers (5)

user92923
user92923

Reputation:

for personal use: ~/src

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

Upvotes: 2

thisjustin
thisjustin

Reputation: 290

@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.

Upvotes: 0

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.

Upvotes: 3

dirkgently
dirkgently

Reputation: 111130

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

Upvotes: 19

Steel Plume
Steel Plume

Reputation: 2290

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

Upvotes: 11

Related Questions