Saturday, 2 February 2008

howto use /usr/local/

Normally when I partition my hard disk for installation of Linux. I will make it like this:
1. 1.5G Swap
2. 10G /
3. 20G /home
4. <10G /usr/local/


/usr/local and its subdirectories are used for the installation of software and other files for use on the local machine. What this really means is that software that is not part of the official distribution (which usually goes in /usr/bin) goes here.


/usr/local/ is the item when I try to keep some partitions not to be formatted, the system prompted me, says some partitions must be formatted, such as /, while some like /home, /usr/local can be kept unformatted. From this on, I leave a partition of /usr/local there. More and more I realized that how to use it: 1. When you "make" program form src, most of the geeks use such a command: sudo ./configure [--prefix=/usr/loca/xxx ......]
This means the programs compiled by you will be kept here, no matter whether you reinstall your system or not, it will always be there. Comparisons with program from .deb, which brings standard destinations and parameters when you install it.
2. /usr/local/bin, where can be a place you put all your favorite "links" here.
3. Some huge programs with licenses, such as Matlab, which just need be installed once, can be stored here. /home can be the places for your documents, while /usl/local is for your programs. (And I found if Matlab is installed in /opt, some java classes compiled by yourself for Matlab will not run correctly, for example, I ever made a java class to be called by Matlab to get configurations from .conf files, when I reinstalled Matlab from /opt to /usr/local, it works correctly, quite weird.)

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter