简体   繁体   中英

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.

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

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

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.

for personal use: ~/src

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM