There is no such thing as the "correct location" it is up to the admin to decide. True, traditionally Linux admins place source files in /usr/local/src
and you are free to do so. You can also place them in your $HOME
, whatever you prefer.
Now, if you are compiling/installing software you are the admin. Therefore, there is no reason why you should not switch to root in order to have access to /usr/local/src
. There is absolutely no reason why you should not compile as root
, that is what every sysadmin I have ever known does, that is why the root
user exists, to perform administrative tasks. This includes the compilation and installation of software.
So, if you are developing software, do it in your $HOME
, if you are installing other people's software from source, do it as root
in /usr/local/src
if you so desire. Personally, I compile programs in $HOME/Setups
because my $HOME
is on a separate partition and that makes it easier for me to upgrade/reinstall my system. That is just a personal choice though and proper sysadmins will compile in /usr/local/src
as root
.
/home/<username>/Code/...
tig
for example - it only have make, and not make install. I manually add the binary to /usr/local/bin. Placing it in my home folder would mean it's only accessible to me.XnView
is another example, without any compilation at all.