Source package installation is the most frequent use of the process of installation, such as Nagios Suite, Apche and other important software is the source package mode installation, source package compilation and installation technology is an important part of the operation and maintenance technology.
First, source package installation Location
Operations, it is best to put the business package to run under the /usr/local/src , convenient for other administrators to manage the code.
Reprint a blog In the Analysis: (Reproduced to https://itony.me/769.html)
Second, the source code installation method
The installation of the source code is divided into three steps:
(1)./configure Some parameters of the custom program. Detects if the system has some libraries that the program is running. After the configuration is complete, a mskefile file is generated for next use
(2) make calls the GCC compiler to compile the source package
(3) make install the relevant directory and configuration file of the program
Operation Example
For an example of installing Apache, learn more about how to install the program through the source package
1. Pre-preparation
Installs the GCC compiler, this program installs the time to be relatively long.
Installing the Wget program
It's officially started.
2, download the Apche source package
First CD to/USR/LOCAL/SRC directory
Download http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz Apche's source package with wget tool
Command: wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz
3. Unzip the source package
Command: Tar xzvf httpd-2.2.34.tar.gz (just review the use of the tar command)
Will come out a lot of things, normal.
LS Look at the results
4. Configure relevant options and generate makefile
Configure the program to be installed in the/usr/local/apache2 directory
Command:./configure --prefix=/usr/local/apache2
And then pop out a lot of hints, as long as no error on him, if you do not install the GCC compiler, this step is difficult.
See if the compilation is good
Command: echo $?
(only)
The return value is 0, no problem.
Look at the generated makefile file
Command:ls -l Makefile
5, to compile
Command: Make (tap Simple)
Another meal, a prayer, no mistakes.
Check to see if it's installed.
Command:echo $?
The return value is 0, no problem.
6, the official installation of
Command make Install
Look at the results.
7. Uninstall the program
Source package installation has a benefit, the program is not running in the directory you specify. When you uninstall, you delete the entire program directory and you're done.
Linux System program installation (c) Source package installation program