In the past when I have compiled applications from source I have extracted the source code to ~/src and compiled from there.

I realize now that there may be no need for me to create the ~/src directory, as Linux probably already has an established location for source code for applications such as this.

Is this the case? What is the directory in Linux that is established as the place for source code from third party applications that I want to compile?

1 Answer 1


There's no pre-determined, or even globally preferred, location. The closest analogue I know of would be the /usr/src tree in Red Hat Enterprise Linux and derivatives, but most applications that you compile are designed to be unrolled into their own directories, compiled as a non-privileged user, and only then installed with root privileges.

  • /usr/src isn't specific to RH, it's traditional and specified in the FHS. Commented Sep 20, 2013 at 22:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .