Linux Package Manager (bottom)--Compile and install

Source: Internet
Author: User
Tags hosting sites

The use of RPM and the Yum Package Manager is described earlier, but sometimes some programs only provide the source code ratio, and we need to compile the installation ourselves. The source code is not placed in a file, and they directly have a variety of dependency relationship. Therefore, a source code building tool is required to organize the source code, and several development package groups specifically address dependency relationships.

The Autoconf tool in Linux automatically generates a configure script that checks to see if the compilation environment on the current system satisfies the compilation needs of the current program, and also identifies the features that the subsequent compilation work expects to compile into the program. The source code that we download from the sources site usually provides a configure script, so it's much easier to install a package using the compile-and-install method.

There are many ways to get source code, such as several well-known open source code hosting sites: apache.org;mariadb.org;sourceforge;github.com;code.google.com. Usually we download the source code is processed as follows: ① expand the Source (Tar xzvf SOURCE.tar.gz), find install, README; When no such file exists, find the official document of the project; ② follow the installation instructions to perform the installation action:./configure (check the compilation environment and determine the compiled attributes, installation path, etc. according to the specified options)------>mke(call the desired compiler to perform the compilation process based on the Makefile profile definition;)-------> make install (installer). Note: The above steps are all done in the unpacked directory.

below to compile and install Nginx as an example, to the reader's friends for further explanation:

First download from the nginx official website http://nginx.org/download/the Hadoop version you want to use: wget http://nginx.org/ Download/nginx-1.6.2.tar.gz

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/5C/wKiom1SAGEnA-pGcAAEVN-cs20M003.jpg "title=" 1204 images 003.png "alt=" Wkiom1sagena-pgcaaevn-cs20m003.jpg "/>

Unzip the GZ tarball: Tar zxf nginx-1.6.2.tar.gz

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/5B/wKioL1SAGVzBrnsyAAC6lcbiMvA944.jpg "title=" 1204 images 002.png "alt=" Wkiol1sagvzbrnsyaac6lcbimva944.jpg "/>

Switch to the extracted Nginx directory: cd nginx-1.6.2.tar.gz

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/5B/wKioL1SAGVzBrnsyAAC6lcbiMvA944.jpg "title=" 1204 images 002.png "alt=" Wkiol1sagvzbrnsyaac6lcbimva944.jpg "/>

View Help documentation: Cat README

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/5B/wKioL1SAGjzxRMSBAAC9QjaFePQ914.jpg "title=" 1204 images 005.png "alt=" Wkiol1sagjzxrmsbaac9qjafepq914.jpg "/>

Execute the./configure command to check the compilation environment and create a makefile file to prepare for make:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/5C/wKiom1SAG1TwTqzrAA3P_uuHeps438.jpg "title=" 1204 images 008.png "alt=" Wkiom1sag1twtqzraa3p_uuheps438.jpg "/>

Execute the make command to compile the source code

Execute the Make install Installer

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/5B/wKioL1SAHSijISW3AAd2yKmLGKU504.jpg "title=" 1204 images 010.png "alt=" Wkiol1sahsijisw3aad2ykmlgku504.jpg "/>

Nginx compiled installation ends. Default installation directory:/usr/local/nginx/sbin/nginx

Note: When using Nginx, be careful to write the full path. Join the system service method, follow-up completion.


This article is from "Xiao Zhi" blog, please be sure to keep this source http://948555452.blog.51cto.com/9146446/1586377

Linux Package Manager (bottom)--Compile and 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: info-contact@alibabacloud.com 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.