Brief introduction to software installation under Linux

Source: Internet
Author: User
Tags config linux


For Windows users, software installation does not have any knowledge, always next or change the path, the software will be installed. But it's not so easy under Linux.



Linux Software installation is mainly three ways, respectively, RPM (Redhat series) or dpkg (Debian series), Yum (Redhat series) or Apt (Debian series) and Tarball.



As RPM, yum and so on are very simple installation methods, here is no longer detailed, to give an example to illustrate that, in Windows, Jinshan These system management software is believed that everyone has been useful, yum Software installation method is similar to you in select a software and then press installation, It will automatically install it for you, but the software that Yum chooses will have to be on the server of the system provider. The RPM installation is similar to when you download an installation package from the Internet and then turn on the direct installation, except that the installation is done by command.



The next point is to say tarball installation.



First, what is Tarball?



See tarball this name, do not know if you have not thought of a command--tar, the so-called tarball file, in fact, the software is all the source code first to the tar packaging, and then compression technology to compress, usually the most common is to gzip and zip2 to compress, So the tarball file extension will be written as *.tar.gz, tgz, or tar.bz2. So what's in this tarball file? The documents are usually:



1, source code files



2, detection Program Files (may be configure or config file)



3, the software simple description and installation instructions (Readme and install)



The Readme and install these two files are very important, but for us accustomed to Windows, install a software is too simple, so we have been ignoring the documentation, but in Linux is different, so before the software installation to read carefully.



Second, testing the installation environment



Get Tarball installation package, you can put it into the/USR/LOCAL/SRC directory (preferably), first find the Readme and install these two files look inside the description, if no problem, in the current directory, Find configure or config files, if not, according to the Readme and install these two files to install, where the assumption configure file exists.



What exactly is a configure file? The file command can be seen, in fact, this document is a script file, it is the purpose of testing your Linux environment, to determine your current environment character does not meet the installation requirements of the software, if not, the output error information and exit, if it is consistent, then generate makefile. MAKEFILE Specifies how the software compiles, installs, and so on.



Because the makefile file is always used after the installation, if this step fails, the installation cannot continue because there is no makefile file generation.



In addition, when running configure, you can also change some of the default parameters in the generated makefile by adding parameters, where the more important parameter is--frefix, which is followed by a path that indicates which directory the software will be installed in the future, if you do not specify this parameter, Usually the default is/usr/local, using the following examples:



# Configure--prefix=/usr/local/app



The default method is: # configure



Third, Software Installation



After all this is done, the installation is very simple, you can enter the following command.



# Make Clean



# make



# make Install



Note: You must use tools such as make and GCC in your system.



is not very simple, yes! So what do you do with each step of the three steps? What are their roles? Let's talk about it!



1, make Clean:make will read makefile in the work on clean, its main task is to remove the target file. This step does not have to have, but it is best to do it, why? It can remove the target file AH. Because the source code may contain the last compiled target file (*.O) exists, so of course, it is more appropriate to clear. At least wait a minute. The compiled execution file can be compiled with your own machine.



2. Make:make will compile the behavior according to the default work of makefile. The main thing to compile is that GCC compiles the source code into an executable file, but these target files usually require links to some function libraries to generate a complete executable file. Simply put, use make to compile the source code into an executable file (that is, a *.exe file under Windows), and the executable will be placed under the directory you are currently in and not installed in the directory you are installing.



See here everyone may be a little confused, since my executable program has come out, I can run the program, is not the installation completed, why did not the installation completed? As a less-than-appropriate example, it's just like creating the installer that you're familiar with in Windows, not the application you want. You will also need to run this installer to complete the installation of the application you want.



3. Make install: This is usually the final step of the installation, made based on the Install option in the makefile file, Install the data that was compiled in the previous step into the default directory (if you used the--frefix parameter, which is the directory you specified, if you previously used configure to detect the environment and generate makefile), you are finished installing. The process of installation typically moves the files that are generated by the compilation and that the software runs to the specified installation directory and makes some configuration.



Note: The above steps are related, and as long as one of them fails, none of the following actions can be performed. In addition, if the installation succeeds but is installed in a separate directory, such as/usr/local/app, then you must manually write the man page of the software into the/etc/man.config, which adds a single line to it: manpath/usr/local/ App/man.



Author Signature: Csdn blog tired Fly l



See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/


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.