Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Where is a good place to store programs? Example: I downloaded, and compiled from source, both Allegro-4.2.2 game dev for C++, and Python 2.6, but they're stored in the /home folder. Is that a good place to store files? I don't think it's good to mix that up with basic things such as music, pictures, or videos, is it?
It makes sense to seperate programs from data, you may want to install programs to /usr/local/bin just don't forget to update your $PATH environment variable.
More generally, take a look at the FHS (http://www.pathname.com/fhs/), which describes what each of the different directories in a Linux system are supposed to be for.
Generally speaking, software that is installed on the local system, that is not to be modified by the package manager, “should” go into /usr/local/ (using /usr/local/bin for binary executables, /usr/local/etc for configuration etc).
Of course, you're free to do what you like with your own computer; the FHS is intended reading for distribution maintainers rather than system administrators. Personally, I find it easiest to try and follow it, rather than making up my own arbitrary system; that way, if another person has to maintain the same computer then they should have some idea of where to find things.
When you say "they're stored in the /home folder", do you mean the actual binaries or the source files? If you mean the source directories themselves, I usually save those in a separate folder in my $HOME, which I call - boringly enough - sources. If you didn't do anything fancy to the programs you compiled, then you probably installed them to /usr/local which is the default choice for many (most?) programs.
This is what I meant by asking if you meant the sources or the binaries. The items in /usr/local/bin are the binaries. They are the compiled and installed programs that you made. The folder in your /home directory is the original sources folder. You can throw it away, but I prefer to create a directory (called sources) and store the source folders there. Sometimes you need to patch and recompile a program, and sometimes you want to uninstall it and the sources may include a make uninstall target. So, just as a thought, you might create a backup folder and move the sources there.
Look at "./configure --help". The "make install" phase will install the files under a base directory. Usually /usr/ or /usr/local. There is an option to change this. Here is an example from grub:
Code:
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
/usr/local/ is the hierarchy for packages you install yourself. If you are compiling a source package that your distro supplies, /usr/ may be the default. /usr/local/ will not be disturbed during a distro upgrade.
If you use /usr/local/ as the prefix, then make sure that /usr/local/bin/ is in your $PATH and /usr/local/sbin/ is in root's path.
Also add /usr/local/lib/ to /etc/ld.so.conf, if it isn't already. Then run "sudo /sbin/ldconfig". This makes sure that libraries installed can be found as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.