Brief Introduction to software installation in Linux
Source: Internet
Author: User
For Windows users, software installation does not have much knowledge. If you keep going to next or change the path, the software will be installed. But it's not that easy in Linux. There are three main methods for installing software in Linux: rpm (RedHat series), dpkg (Debian series), yum (RedHat series), APT (Debian series), and tarball. Rpm, yum, and other installation methods are very simple, so we will not detail them here. Let's take an example to illustrate it, in Windows, Kingsoft, and other system management software, I believe everyone has used it. The yum software installation method is similar to selecting a software in and then following the installation method, it will automatically help you install the software, but the software selected by Yum must be available on the server of the system provider. The RPM installation is similar to the installation of an installation package downloaded from the Internet, and then you can directly install the package, but the installation is carried out using commands. Next we will focus on installing tarball. I. What is the name of the tarball? I don't know if you think of a command named tar. The so-called tarball file is to package all the source code of the software in tar first, then we use the compression technology to compress the files. The most common is gzip and zip2. Therefore, the general extension of the tarball file will be written as * .tar.gz?tgz=tar.bz2. So what is in this tarball file? Files usually include: 1. source code file 2. program file (may be configure or config files) 3. easy description and installation of the software (Readme and install) the readme and install files are very important, but for those who are used to Windows, installing a software is so simple that we have always ignored these instructions, however, Linux is different, so read carefully before installing the software. 2. Check whether the installation environment obtains the tarball installation package and decompress it to the/usr/local/src directory (preferably ), first, find the README and install files to see the instructions. If there is no problem, find configure or config files in the current directory. If not, you can install the tool according to the instructions in readme and install files. Here we assume that the configure file exists. What is the configure file? Through the file command, we can see that this file is actually a script file. Its purpose is to detect your Linux environment and determine whether your current environment meets the installation requirements of this software, if not, output error information and exit. If yes, generate makefile. Makefile specifies how the software is compiled and installed. Since makefile is always used for subsequent installation, if this step fails, the installation cannot continue because the MAKEFILE file is not generated. In addition, when running configure, you can add parameters to change some default parameters in the generated makefile. The most important parameter is -- frefix, which is followed by a path, indicates the directory to which the software will be installed. If you do not specify this parameter, the default value is/usr/local. The usage example is as follows: # configure -- prefix =/usr/local/APP default method: # configure 3. After software installation is completed, the installation is very simple. Enter the following command. # Make clean # Make # make install Note: Make and GCC tools must be used in your system. Is it easy? Yes! So what have you done in each of the above three steps? What are their respective functions? Let's talk about it now! 1. Make clean: Make will read the clean work in makefile. Its main task is to remove the target file. This step may not be required, but it is best to execute it. Why? It can remove the target file. Because the source code may contain the target file (*. O) compiled last time, clear the file properly. At least wait until the compiled execution file is compiled by your machine. 2. Make: Make will compile Based on the default work in makefile. The main task of compiling is to compile the source code into executable files by GCC. However, these target files usually need links such as libraries to generate a complete executable file. To put it simply, you can use make to compile the source code as an executable file (that is, * in Windows *.. It may be a bit confusing to everyone here. Since all my executable programs have come out, I can run the program. Isn't the Installation Complete? Why? For example, this is like generating only the installer you are familiar with in windows. It is not the application you want. You need to run this installer to complete the installation of the desired application software. 3. Make install: This is usually the last step of installation. Make will follow the install option in the MAKEFILE file, install the data compiled in the previous step to the default directory (if you used configure to detect the environment and generate makefile, you can use the -- frefix parameter, is the directory you specified) to complete the installation. The installation process usually involves moving the files generated by compilation and software running to the specified installation directory for some configuration. Note: The preceding steps are associated. If one of the steps fails, the following operations cannot be performed. In addition, if the installation is successful but is installed in an independent directory, such as/usr/local/app, then you must manually write the man page of the software into/etc/man. in config, add a line: manpath/usr/local/APP/man.
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.