LINUX Package Management: rpm/yum/compilation

Source: Internet
Author: User

How does Linux perform software installation? 650) this.width=650; "src=" http://pic64.nipic.com/file/20150419/14041019_214643072000_2.jpg "width=" "height=" "alt=" 14041019_214643072000_2.jpg "/> said that the software installation, the habit of Windows to install software friends will certainly say, so easy is not the next chant, But installing software in the Linux system is not so simple, although Linux can be in the image interface similar to Windows under the next click on the way to install, but this to your force of the promotion can not be effective, the following will introduce you to Linux software installation.
Linux packages are divided into two types:
    • SOURCE Package

    • Binary Package


The so-called source code package refers to the software developer with a text processor program code, is written to the human look of the program language, but the machine does not know so can not be executed.
The binary package is the software beforehand in the hardware and the operating system compiled into binary code, and then the software of all related files packaged into a special format of the file, in this software file also contains a pre-detection system and dependent software script, and provide software to provide all the file information, plus easy installation /delete/manage mechanism, and eventually publish this software file. After the client obtains this file, as long as through the specific instructions to install, then the software file will be in accordance with the internal script to detect the presence of dependent precursor software, if the installation of the environment to meet the requirements, it will start the installation, after the installation of the software will also write information to the software management mechanism. ,
There are at least two common software administrators on Linux, namely RPM and Debian dpkg. CentOS is mainly based on RPM.
    • DPKG:
      This mechanism was first developed by the Debian Linux community, and through the dpkg mechanism, the software provided by Debian could be installed simply and provided with post-installation software information. As long as other Linux distributions that derive from Debian use the dpkg mechanism to manage software, including b2d, Ubuntu, and so on.

    • Rpm
      This mechanism was originally developed by the Red Hat company, and it was very useful, so many distribution s used this mechanism as a way to manage software installations. Well-known developers, including Fedora, CentOS, SuSE and so on, are using this.


What is RPM? RPM Full name is Redhat Package Manager abbreviation is RPM! As the name implies, this software management mechanism was developed by the Red Hat company. RPM is a set of management mechanisms for installing the software you need into your Linux system in a database-logged way.
The advantages of the binary package his biggest feature is that you want to install the software first compiled, and packaged into the RPM mechanism of the packaging files, through the packaging of the software in the default database records, the software must be installed in the installation of the dependency property software, when installed on your Linux host, RPM Will first follow the data in the software to query the Linux host dependency property software is satisfied, if satisfied to install, if not satisfied will not install. Then the information of the software is written to the RPM database for future query, verification, and anti-installation. The advantages are:
    1. Software transfer and installation is convenient (no need to recompile) because it has been compiled and packaged

    2. Since the software information has been recorded on the Linux host database, it is convenient to query, upgrade and anti-installation

The drawbacks of binary packages but this also creates a bit of confusion. Since the RPM file is already packaged data, that is, the data inside is already compiled and completed!   Therefore, the software file can only be installed in the original default hardware and operating system version. Therefore, the RPM files that are usually released by different distribution cannot be used on other distributions. Thus, the problem with these software management mechanisms is that:
    1. The environment in which the software files are installed must be consistent or equivalent to the environmental requirements at the time of packaging

    2. Need to meet the dependency property requirements of software

    3. Anti-installation requires special care, the lowest software can not be removed first, or may cause the whole system problems


Say 1000 to 10,000 let's take a look at the real thing! Let's mount the Linux system CD on the packages directory into the CD to execute the LL command:
[[Email protected] packages]# ll-r--r--r--.  2 root root     24280 may 29  2013 perl-xml-dumper-0.81-8.el6.noarch.rpm-r--r--r--.  2 root  root     9780 Jul  2  2011  Perl-xml-filter-buffertext-1.01-8.el6.noarch.rpm-r--r--r--.  2 root root     70612 jul  2  2011 perl-xml-grove-0.46alpha-40.el6.noarch.rpm-r--r--r--.  2  root root   372868 Jul  2  2011  Perl-xml-libxml-1.70-5.el6.x86_64.rpm-r--r--r--.  2 root root    17364  Jul  2  2011 perl-xml-namespacesupport-1.10-3.el6.noarch.rpm-r--r--r--.  2  root root   229296 jul  2  2011  Perl-xml-parser-2.36-7.el6.x86_64.rpm-r--r--r--.  2 root root     10080 jul  2  2011 perl-xml-regexp-0.03-7.el6.noarch.rpm-r--r--r--.  2 root root    79664 Jul  2  2011  Perl-xml-sax-0.96-7.el6.noarch.rpm-r--r--r--.  2 root root    24460 jul   2  2011 perl-xml-sax-writer-0.50-8.el6.noarch.rpm-r--r--r--.  2 root  root   206288 jul  2  2011  Perl-xml-twig-3.34-1.el6.noarch.rpm-r--r--r--.  2 root root    27028  Jul  2  2011 perl-xml-writer-0.606-6.el6.noarch.rpm-r--r--r--.  2 root  root    81608 jul  2  2011  Perl-xml-xpath-1.13-10.el6.noarch.rpm-r--r--r--.  2 root root    42296  Jul  2  2011 perl-xml-xpathengine-0.12-3.el6.noarch.rpm-r--r--r--. &Nbsp;2 root root    77168 jul  2  2011  Perl-yaml-syck-1.07-4.el6.x86_64.rpm-r--r--r--.  2 root root    34180  Jul  2  2011 perl-yaml-tiny-1.40-2.el6.noarch.rpm-r--r--r--.  2 root  ROOT   130004 JUL  2  2011 PESSULUS-2.28.0-1.EL6.NOARCH.RPM Omit n Multiple lines      Specify the installation location and configuration file location of the source package:     next compile with make     This time we can look at makefile this file already exists.     Next make install  Install this package     install to complete the source package after installation can directly use the relevant commands? No, we go to the installation path of the source package look     can see here are bin ,lib ,include ,man  these several files, These files will not work in this directory unless we use the absolute path to the command. Below we will put these "personality" documents into the arms of the organization. Enter the/ETC/PROFILE.D directory to create a http.sh  file, open the file to add the following      now the PATH variable contains the installation directory of the new installation source package, In the installation directory of the new installation source package, the commands in the bin  directory can be used. Enter the/ETC/LD.SO.CONF.D directory, create a new file for http.conf, open the file to add the following content   &nbsp, and then use the Ldconfig command to have the system regenerate the cache. Copy the Include directory under the source package installation path to the/uer/include directory. Edit/etc/man.config file Add a Manpath, as follows:         now our source package function can be fully used.

LINUX Package Management: rpm/yum/compilation

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.