Installation and management of software packages under Linux

Source: Internet
Author: User
Tags command line php and

One source installation method

Because Linux operating systems open source code, most of the software installed on it is open source software, such as Apache, Tomcat, PHP and other software. Open source software basically all provide source download, source installation of the way; The advantage of the source code installation is that the user can customize the software function, install the required modules, the function does not need to install, in addition, users can choose their own installation path, convenient management, uninstall software is also very convenient, just delete the corresponding installation directory can be. There is no mention of Windows called Registry.

The source code installs the software generally to have the following several steps to compose: Download the decompression source code, the analysis installs the Platform Environment (Ifconfigure), compiles installs the software (Make,make install). Below we introduce separately.

1.1 Download Extract Source code

Linux under the software is generally the source of C or C + + language written, and will be on the official website of the software to provide the source code package download, such as the Apache Open Source project's official website for http:// Www.apache.org, in addition to the online many open source communities generally also provide some commonly used software source download, the source code are packaged into compressed files, the common source packaging compression format has ". tar.gz", ". Tar.baz2" and so on. We can download the source file from the website first, and then, under the Linux system, if your Linux system is networked, you can download the source package directly to the Linux system via download commands such as wget in the system.

Download complete, the corresponding software solution can be, for the different download software packages, using different methods for decompression, decompression after the completion of the resulting directory, in this directory, there are generally a redame file, this text file is very important, it detailed description of the software can complete the function, Licensing, installation requirements, installation considerations, installation methods and so on, due to the different versions of Linux, as well as the installation environment, the installation of software is not the same, so before installing software, must read this readme file, to ensure the correctness of installation.

1.2 Analysis of Installation platform environment

After the package is decompressed, we enter the source directory, there are generally configure and readme so two files, the Readme is the above we talked about, is the introduction of the software and installation instructions; Linux under the installation of software under the operating system installation environment impact, For example, some software in the installation or operation of the operating system needs to invoke the library files, or need to run a system of a tool, etc., but the system does not exist in the library or the tool is not installed, then install or run the software will fail.

To avoid this problem, it is necessary to analyze the operating system environment when installing the software, to detect whether the current system has all the files and tools needed to install the software, and to give a hint if a file is missing from the system until all the requirements of the software are met. This is the function of the Configure file, configure file is generally an executable file, you can enter the current directory directly to the "./configure" Software installation of the environment test, if prompted the lack of some installation package, you need to install until the test pass. Typically, the source installation requires either GCC or CC compilers, which are typically installed under the development Tools option in the installation package when installing the system, which is why we need to choose the Development Toolkit in the second chapter of the Linux installation system.

In addition, when performing configure analysis software requirements, you can also customize the software features that users require by adding the software installation path after "./configure" and some options for installing the required modules and so on.

1.3 Compiling and installing software

After verifying the software installation environment, formally enters the software the compilation step, before compiles, first understands some basic knowledge about the compilation.

In Linux, make is the compile command that we often use, whether it's installing software or project development, often using compile-and-install commands, make and make install, for an application that contains a lot of source files, With the make and makefile tools, you can quickly and easily resolve complex dependencies between individual source files, while the Make tool automates the compilation of all source files and can only incrementally compile files that have been modified since the last compilation. After mastering the make and makefile tools, the source installation software becomes as simple as installing software under Windows.

Makefile file

The main function of the Make tool is through the makefile file, the makefile file is written in some syntax, the dependencies between the source files are defined in the file, and how to compile the source file and build the executable file. It allows make tools to automate compilation by describing the relationships between the source programs.

In the Linux system, the habit of replacing the makefile file with makefile, after we execute configure, we will generate the file in the current directory, usually when you enter make in the command line, The make command defaults to finding the makefile file in the current directory, and if we use other files as makefile, we specify the makefile file after the Make command option, for example, if we set the compile rule file to Make_file, we need to specify the following command:

[Root@webserver ~] #make-F Make_file

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.