Linux Software Installation: source code and Tarball

Source: Internet
Author: User


I. Introduction to open source software installation and upgrade


1. Open source, compile program and execute file


Open Source: is the program code (a plain text file full of program code);

Compile the program: link The program code to the library and translate it into a language that the machine can understand;

executable file: the machine can understand the binary execution file.

Diagram of the three relations:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/84/wKiom1XSv3uwAOdrAAEh53TP3Eg673.jpg "title=" Clipboard.png "alt=" Wkiom1xsv3uwaodraaeh53tp3eg673.jpg "/>



2. Function library


function Library: A function function, such as a subroutine, that can be called to execute.


Diagram of the external dynamic function library call situation:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/87/wKiom1XS6FaQcMLcAAC-Ig7lNec382.jpg "title=" Clipboard.png "alt=" Wkiom1xs6faqcmlcaac-ig7lnec382.jpg "/>


· The Linux kernel provides a large library of functions for use by hardware developers (system calls);

• Knowledge of the above diagram allows hardware developers to develop products related to hardware characteristics by invoking kernel function libraries;

• Software developers can also develop relevant software based on kernel function libraries.



3.make and configure


Make : a program, make will search the current directory for makefile (or makefile) this text file

Makefile: The details of how the source code is compiled are documented, and the Configure program detects that the environment has been successfully generated

Configure: a program developed by software developers to detect whether a user's operating environment has the functionality required by a software developer


• Compile the command with a lot of code when compiling a large amount of data using a gcc-like compiler (many small programs);

The make program can simplify the process of compiling commands;

• Execute make, first perform configure detection environment, then generate makefile file, finally according to makefile content to compile the source code;

Configure the data that needs to be detected:

A. Is there a suitable compiler program code to compile the software

B. Is there a library of functions or other required software required for the software?

C. Whether the operating system platform is suitable for the software, including the kernel version of Linux

D. The kernel header definition file (header Inclde) is present (the driver must be detected)


Figure:make->configure->makefile-> Compiling, building the final software

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/87/wKiom1XS7oaAxYy2AAHH8ppSGNI269.jpg "title=" Clipboard.png "alt=" Wkiom1xs7oaaxyy2aahh8ppsgni269.jpg "/>


-The reason for the need for environmental testing

• Each Linux distribution uses the same kernel, but the kernel version may not be the same;

• system calls (corresponding kernel function libraries) used by different versions of the kernel may not be the same;

• Different Linux distribution function library file path, function library filename definition or default installation of the compiler program are not the same;

• The relevant library of functions required for each software is not the same;

• Software developers are not only for Linux development, but for unix-like development;

Therefore, in order to ensure the normal use of the software developed, it is necessary to test the environment to obtain relevant environmental information, make the correct compilation call.

• Therefore, in theory, the CentOS-compiled software can not be executed directly in Ubuntu and needs to be recompiled.



Software for 4.Tarball


Pure file files: a file format that is a waste of bandwidth when transmitted over a network, where the source code is the file format

gzip: A compression technique that uses this compression technique to compress filenames that are generally *.tar.gz

Tarball: the file that is obtained after compressing the source code file by gzip technology is a package


• Source code files sharing on the network is a waste of bandwidth;

• The use of GZIP technology to package source code files can solve this problem;

• The packaged file is called the Tarball file, i.e. Tarball is a software package;

• After extracting tarball, you can usually get:

A. Source code files

B. Test program Files (configure or config file names)

C. Simple description of the software and installation instructions (install or readme)



5. Installing and upgrading the software


Compile: translating a source code file into a machine-readable binary executable program by compiling a program

Installation: from the source code compilation to the software can be really used, can be considered as installation; the compilation of the generated binaries together to form a fully functional software, can also be considered to be installed


--Software updates

• Two main ways to update software:

A. Install and upgrade directly from the source by compiling

B. Install and upgrade directly with a compiled binary program

The a method has high selectivity in the installation process, but it is relatively troublesome.

・the method, Linux distribution vendors for their own Linux platform to compile the process, and then the compiled binary program release, so that can be installed directly on the platform, eliminating the process of detection and compilation, saving time;

The ・the method, the "pre-compiling mechanism of the program", is called the package management mode;

• Package management mode exists in many distribution, such as RPM, Yum, dpkg and apt;


--Software Installation

• As you know, there are two ways to provide software installation, that is, the compilation and package management mode;

• The process for compiling the installation is:

A. Download the Tarball

B. Extracting tarball to generate many source code files

C. Start compiling the source code with the GCC and other compilers (the target file will be generated)

D. Then link the function library, main program, and subroutine with GGCC to form the main binary file

E. Install the above binaries and the associated configuration files on their hosts

The C and D steps have been simplified by make.
















This article from "Fragrant fluttering leaves" blog, reproduced please contact the author!

Linux Software Installation: source code and Tarball

Related Article

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.