LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /usr/src usage (https://www.linuxquestions.org/questions/linux-newbie-8/usr-src-usage-133603/)

sofasurfer 01-11-2004 03:48 AM

/usr/src usage
 
Am I correct in understanding that the sole purpose of the /usr/src directory is for storage of downloaded and unzipped files?

I thought that anything that I added to my system should be manually placed into my user directory and that other directories were for the system to use and place things in.

scott_R 01-11-2004 04:39 AM

>"Am I correct in understanding that the sole purpose of the /usr/src directory is for storage of downloaded and unzipped files?"

No, just source files.

It's always up to you where to store things, of course, one of the beauties of an OS that allows you the freedom to do so. That said, most people use their home directories for experimental or personal stuff, reserving /usr/src for things installed system wide. The reason you might want your code in /usr/src is so other programs you install can find it easily. Linux kernel source is often placed in a /usr/src subdirectory so your compiler can find it if you need to compile a driver for use with your kernel.

Other times, you might want several people to be able to browse the source as a reference (or to read included source documentation), without allowing them to change it, yet avoid the CVS setup.

>"I thought that anything that I added to my system should be manually placed into my user directory and that other directories were for the system to use and place things in."

You'll want anything that's "yours" in your user (/home/yourname) directory. Everything else has varying needs. /root is for the administrator, /boot is for the kernel and associated files, /etc is configuration, etc. /usr is "shared", and generally includes stuff you want other users to be able to access.

While you yourself may not have a need for others to use anything on your system, a lot of prepackaged software will want to be installed in /usr, even though it might run just as well in your home directory. (Mozilla is a good example. The release versions want to be available to everyone and install in /usr, but the nightlies run just fine in your home directory.)

Generally speaking however, it's up to you. Put it where you prefer. On the other hand, if you want something to "play nice" with other software or be able to be seen by other software, do what the author recommends, as in the kernel source example above. If you don't particularly trust a peice of software, you can try installing it with your user account into a /home directory, and see if that works. That way, you're offered some protection if it does try to trash your system. (Most won't however, because they expect rights to kernel-related processes and software.)

For most newer users, I wouldn't worry about it too much, and just install it as recommended by the developer. That way you don't have to move it around later when something else expects it to be in a certain place.


All times are GMT -5. The time now is 11:48 AM.