Normal compile and install / uninstall
Source installation generally consists of three steps:
- Configuration (
configure
) - Compile (
make
) - Installation (
make install
).
configure
File is an executable script file, it has a lot of options, use the command in the source directory to be installed ./configure –help
can output a detailed list of options.
Where --prefix
option is to configure the installation directory, if you do not configure this option after the installation executable file in the default /usr /local/bin
library file in the default /usr/local/lib
,
The default configuration file in /usr/local/etc
other resource files are placed /usr /local/share
, messy.
If configured --prefix
, such as:
./configure --prefix=/usr/local/test
All resource files will be placed in the installation /usr/local/test
directory, it will not divert to another directory.
Use --prefix
Another benefit is the convenient option to uninstall the software or the software migration
- When a software installation is no longer required, just simply delete the installation directory, you can uninstall the software and clean;
- Transplantation software only needs to copy the entire directory to (under the same operating system) to another machine
Of course you want to uninstall the program, also in the original make
with a directory make uninstall
, but only if the Makefile
file has uninstall
command.
About uninstalling
If no --prefix
option, did not provide source package make uninstall
, it can be a complete uninstall in the following ways:
A temporary directory reinstall it again, such as:
./configure --prefix=/tmp/to_remove && make install
Then traverse the /tmp/to_remove
document, such as the vim / bin / vimdiff => find / usr / -name vimdiff
Delete the corresponding files to the installation location (as /tmp/to_remove
in the directory structure is not configured --prefix
directory structure when the option).
reference: