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.
Well, all this is really informative. I have not yet managed to install any package on my Linux system, but I already have a clearer view of the mechanism, issues, pros and cons.
If you allow me to sum up:
While Windows does everything, in Linux you have to do it manually (or with RPMs that work if you are lucky). You have to untarr the files, check whether you are able to install with ./configure, then compile with make, and finally dispatch the files with make install.
There are different directories involved: /usr/ or /usr/lib or /lib . I have yet never seen any of these in my file manager. Are they visible through the KDE graphical interface? If I go to the command prompt I guess I should be able to find them but how are these directory organised?
Is /usr/ parallel to /home/ ? What about /lib?
Suppose I know where my directories are. I am concerned about the /lib directory that contains all libs (equivalent of windows'dll's). These libs can be shared by several programmes, that is something you want to avoid I presume if you don't want to end up with a big knot of files and dependencies. Is there a simple trick to avoid these dependencies? Could you store your libs in /lib/package1/ for package 1 and lib/package2/ for package 2 ect..?
I also read you ought to verify your libs are up to date, how do you do that? I suppose you can end up with a huge amount of libs in your /lib directory.
Other thing, if you run make install, I understood it will dispatch the files here and there where they are supposed to be. Well, how does that work? Does make install uses the same process for all programs and throw each file type in their own directory? or does it depend on the package you install?
Originally posted by kobayashy
Suppose I know where my directories are. I am concerned about the /lib directory that contains all libs (equivalent of windows'dll's). These libs can be shared by several programmes, that is something you want to avoid I presume if you don't want to end up with a big knot of files and dependencies. Is there a simple trick to avoid these dependencies? Could you store your libs in /lib/package1/ for package 1 and lib/package2/ for package 2 ect..?
I also read you ought to verify your libs are up to date, how do you do that? I suppose you can end up with a huge amount of libs in your /lib directory.
Other thing, if you run make install, I understood it will dispatch the files here and there where they are supposed to be. Well, how does that work? Does make install uses the same process for all programs and throw each file type in their own directory? or does it depend on the package you install?
Thank you for clarifying all this.
Kobayashy
make install takes its instructions for the Makefile, specific to each program and written by either the program's author or the configure script. It isn't the same for every application. Some Makefiles may only install a binary and will put it in /usr/local/bin by default and others may have more to install and put it in /usr/local/<programname>. You can change where a program installs its files by running ./configure with the --prefix=<base directory> switch. For example. most configure scripts set the Makefile to install the program in /usr/local, but if you run ./configure --prefix=./usr it will put it in /usr instead (with the binary in /usr/bin).
And no, you don't want to avoid shared libraries. That's the whole reason they exist. If they were a bad thing then they wouldn't be used! Imagine how many applications use GTK...now if you were going to install the GTK libraries into a specific directory for each application then you'd have hundreds of instances of it installed! Shared libraries are a way of saving space. And don't worry about 'dependencies' with regards to having multiple versions installed, it doesn't work like that. A system of symbolic links means you can have many versions of the same library installed without ever causing problems with older programs.
komakino; thanks for clearing knowledge, after reading those phrases in linux text books was dumb founded now it becomes clear. elucidated with
new vision thank you! this is what makes linux best , windows can not touch at all.
You can change where a program installs its files by running ./configure with the --prefix=<base directory> switch. For example. most configure scripts set the Makefile to install the program in /usr/local, but if you run ./configure --prefix=./usr it will put it in /usr instead (with the binary in /usr/bin)
Yes thank you, it makes it indeed all clearer, now only one extra little thing:
If I ./configure with a --prefix, it will store my files in the directory I wish and in a /bin subdirectory for binary files. Now if I use that, will the Libraries be stored alltogether in the common /lib to all programmes? (And thus not making doubles as you mentionned?) Or will the prefixe affect these Libs too? (which I don't want since you convinced me not to separate them)
The first option would be a lot funnier of course !
Well in linux the programs get separated into library directories and binary directories (like /usr/lib and /usr/bin) anyway. The --prefix option doesn't change the exact installation directory, it just changes the base install directory. For example if you specify a prefix of /usr/local/myprograms/games then the libraries are still in /usr/local/myprograms/games/lib and the binary is still put in /usr/local/myprograms/games/bin. You can have finer control over this though. Type:
Code:
./configure --help | less
(that's the pipe symbol, found next to backspace on a US keyboard) to see what configuration options there are. Sometimes you can specify the exact location you want to install the complete program, but:
1. If you put the binaries in a directory that is not in your path then you will have to type the complete path to load the program, or put a symlink in a directory that IS in your path, or add the directory to your path.
2. If you put libraries in a non-standard location then they won't be in the LD_LIBRARY_PATH so the linker won't find them.
3. Also, if you put libraries in a non-standard location then pkg-config won't find them so configure scripts that use pkg-config to determine what libraries are installed won't find them.
What I usually do (and this is just me, it's not a rule or anything) is I install any libraries that are likely to be used by other programs (things like GTK, Qt, Freetype...) in /usr/lib (by specifying ./configure --prefix=/usr) and any programs (like games, applications...) in /usr/local (the default location for a configure script).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.