In the CentOS system, software Installation procedures are quite complex, but the most common are two types:
1 One is the source code of the software, you need to manually compile it. This software installation package is typically a tar package with gzip compression (suffix is. tar.gz).
2 Another is the software executable program, you just install it on it. This software installation package is usually an RPM package (Redhat Linux Packet Manager, the Redhat Package Manager), and the suffix is. rpm.
Of course, also useful in the RPM format packaging source code, with gzip compressed executable package. As long as you understand the following ideas, these two forms of installation package is also a cinch.
Below, we are divided into two parts to explain the software installation idea:
Part One: Fix it. tar.gz
First, copy the installation files to your directory. For example, if you are logged on as root, copy the software to /root .
----#cp filename.tar.gz/root
----Because the file is compressed and packaged, it should be decompressed. Command:
----#tar xvzf filename.tar.gz
----Execute the command, the installation file is decompressed by path under current directory . Use the LS command to see the uncompressed file. A file known as "INSTALL" in a file that is typically produced after decompression. This file is a plain text file, detailing how the package is installed.
----For most software that needs to be compiled, they are installed in much the same way. An executable script named Configure that is produced after the decompression is performed. It is the system information required for installation to check whether the system has the necessary libraries to compile, and whether the version of the library meets the needs of the compilation. Prepare for the subsequent compilation work. The command is:
----#./configure
----If an error is found during the inspection, configure will give a prompt and stop the check. You may be prompted to configure the system. Re-execute the program again. After the check is passed, the makefile file for compilation is generated. At this point, you are ready to start compiling. The process of compiling depends on the size of the software and the performance of the computer, and the time spent is different. Command is:
----#make
----successfully compiled, type the following command to begin the installation:
----#make Install
---- installed, clear compile process and the files generated during the configuration process . Type the following command:
#make clean
#make Distclean
This is the end of software installation
1. First, use TAR-XZVF to unlock this package, such as:
#tar-XZVF apache_1_3_6_tar.gz
This creates a new directory in the current directory (similar to the file name of the. tat.gz package) to store the extracted content. In this case, it's apache_1.3.6.
2. Enter this directory, and then use the LS command to view the included files, such as:
#cd apache_1.3.6
#ls
You observe which of the following files is included in this directory: Configure, makefile or Imake.
1 if it is a configure file, execute:
#./configure
#make
#make Install
2 If it is a makefile file, execute:
#make
#make Install
3 If it is a Imake file, execute:
#xmkmf
#make
#make Install
The Make principle is to execute a command called (generated) makefile file, the basic use of making is to automatically compile the source file according to the instructions in makefile. It can also be used to do things like installing software, uninstalling software, and so on, but only if the author wrote it in Makefile. For example, there are some things in makefile:
Install: < commands >
Then, with make install, the made program will follow the above install: The following instructions < commands > perform the installation, uninstall is the same, most of the authors will write the uninstall part, then simply execute make Unistall can, if the author is lazy did not write, it is only according to the steps in make install, see what files it is copied to where, and then manually delete.
The key point is that after compiling the installation, do not delete the source code, or even if the author wrote the Unnistall target, you do not makefile can be executed.
3. If there are no error prompts, it is done. as to where the software is installed, it usually occurs during installation. Otherwise you can only check the README.
To perform a command to view the installation directory :RPM-QL Apache
If you get a bad tip, don't worry, it's usually a very simple question:
1 does not have the C or C + + compiler installed:
Confirm method: Execute command gcc (c + + is g++), prompt cannot find this command.
Workaround: Mount the Linux installation CD and then go to the RPMs directory and execute the command:
#rpm-ivh gcc* (haha, we used the second installation method)
2 does not have the Make tool installed:
Diagnose method: Execute command make, prompt cannot find this command.
Workaround: Mount the Linux installation CD and then go to the RPMs directory and execute the command:
#rpm-IVH make*
3 The Autoconf tool is not installed:
Diagnose method: Execute command make, prompt cannot find this command.
Workaround: Mount the Linux installation CD and then go to the RPMs directory and execute the command:
#rpm-IVH autoconf*
(4) Lack of some link libraries;
How to diagnose: when make, you are prompted for some files.
Workaround: Install the package containing the file, which requires accumulation.
Part Two: Get it done. RPM
RPM is Red Hat company with Redhat Linux has launched a package manager, through which it is easier to easily implement software installation.
Copy the installation files to your directory/usr/src. Then use RPM to install the file. The commands are as follows:
----#rpm-ivh filename.i386.rpm
----RPM will automatically unpack the installation files and install the software into the default directory. and register the software installation information into the RPM database.
1. Install software: Execute RPM-IVH RPM package name, such as:
#rpm-IVH APACHE-1.3.6.I386.RPM
2. Upgrade Software: Execute RPM-UVH RPM package name.
3. Reverse install: Execute rpm-e RPM package name.
4. Query Package Details: Execute rpm-qpi RPM Package name
5. Query for a file that belongs to the RPM package: Execute RPM-QF RPM Package name
6. Check which files the package will write to the system : Execute RPM-QPL RPM package name