Source code is text; text is architecture-independent data (i.e., /usr/shareable). Would it be, for some reason, a bad idea to have /usr/src/ link into /usr/share/src in a Linux distro?

  • 1
    Some source code is architecture or OS specific. Aug 10, 2015 at 15:52

1 Answer 1


In Unix and clones like Linux, /usr/src is not just for any source code. It is traditionally where you put the source code for the running operating system. The basic build tools for each OS and their configuration files are set to use /usr/src and if all you did was ln -fs /usr/share/src /usr/src then those tools are still going to find it in the expected spot. Such is the whole point of file linking.

However, ever un*x system I have worked on in the past 25 years has let you set where the build tools find the source, place the compiled object files, place the man pages, place the linked binaries (programs and libraries) and so on. This is often used for installing the newly built system to a second hard drive that you could then detach and pop in a second computer to boot from instead of updating your own OS. Or for having multiple source archives available at the same time for multiple versions or different architectures and you just run the build tools with different config files. This means that there is no need to link thing to or from different locations.

So no, it's not a bad idea, per se, but why by bother changing things from the usual unless you have need to do so? It's just one more thing to potentially forget and be the cause of mistakes later on.

  • Thanks. Actually doing it wasn't the goal. Understanding was.
    – PSkocik
    Aug 10, 2015 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.