How to use Configure PREFIX=USR in Linux

Source: Internet
Author: User

When you compile and install software on Linux, you often encounter./configure prefix=usr This command ... what does/configure-prefix mean? Here is a brief introduction to the use of/configure-prefix.

The installation of the source code typically consists of these three steps: Configuration (Configure), compilation (make), installation (make install).

Configure is an executable script that has many options for using commands under the source path to be installed./configure-help output A detailed list of options.

Where the-prefix option is the path to configure the installation, if this option is not configured, the executable file is placed by default in/usr/local/bin, the library file defaults to/usr/local/lib, and the profile defaults to/USR/LOCAL/ETC, Other resource files are placed in/usr/local/share and are more dispersed.

To facilitate centralized management of a variety of files for a particular software, you can configure-prefix, such as:


You can put all the resource files in the/usr/local path, and you won't be distracted.

Another benefit of using the-PREFIX option is uninstalling the software or porting the software. When an installed software is no longer needed, simply remove the installation directory, you can uninstall the software cleanly; the porting software simply copies the entire directory to another machine (the same operating system).

Of course, to uninstall the program, you can also use the make uninstall once in the original made directory, but only if the make file specifies uninstall.

Configure is an executable script that has many options, using commands./configure-help output A detailed list of options, as follows:

usage:configure [Options] [host]
Options: [Defaults in brackets after descriptions]
--cache-file=file cache test results in file
--HELP Print this message
--no-create do not create output files
--quiet,--silent does not print ' checking ... ' messages
--version Print the version of autoconf that created configure
Directory and file names:
--prefix=prefix install architecture-independent files in prefix
--exec-prefix=eprefix install architecture-dependent files in Eprefix
[Same as prefix]
--bindir=dir user executables in DIR [Eprefix/bin]
... (omit a number of)

A lot of options, personally think, can ignore everything else, but please add-prefix.

For example, to install supersparrow-0.0.0, you intend to install it to the directory/usr/local/supersparrow, and then execute the script with options in the supersparrow-0.0.0 directory:


Compile and install after successful execution (Make,make install);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.