So I just had a simple question that's probably going to make me look dumb, but I'm learning
When I do a
./configure --prefix/usr/bin/
What is the prefix doing ? Is this just installing the package into that location
And can a reply give more of an elaborate answer for a complicated install and explain in detail the prefixes and options that go with it.
If I was to run an apt-get install how would I install it to a certain location with prefix
I've also seen
PREFIX=/tmp/installdir make
PREFIX=/tmp/installdir make install
If prefix is called in ./configure why is it always being made in these two examples ?
Thank you in advance!
When you install software with
make install
orsudo make install
, different files are placed in different directories. Executables that provide commands the user is intended to run usually go in abin
directory, libraries usually go in alib
directory, manual pages usually go in aman
directory, and so forth.When you run
./configure
, the--prefix
option lets you specify where those directories are. It is called--prefix
because it lets you give the prefix that appears in the paths to each of the directories where files from the program or library that you are building are to be installed. Mostconfigure
scripts support--prefix
, and omitting it and just running./configure
is typically equivalent to./configure --prefix=/usr/local
.To answer this more fully, I've reproduced two sections from my answer to How to install tar file “globally”? (on Unix & Linux), which address this question specifically:
It tells the location of the things which are required to configure the current package or software.
Like in a simple case, it can tell the location of ssl libraries:
and it also tells which packages not to configure, to make suitable compilations of the program according to your system:
These are just extra options to make a compilation suitable for your system. It is what I think. Do correct me if it is something else.
The
--prefix=PREFIX
option installs architecture independent files inPREFIX
. When you run amake install
command, libraries will be placed in thePREFIX/lib
directory, executables in thePREFIX/bin
directory and so on.If this argument is not passed to the
configure
command then the default value is/usr/local
.