RPM and Tarball Suite Administrator

Source: Internet
Author: User
Article title: RPM and Tarball Suite Administrator. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Why do we need to upgrade the suite?
This is really an interesting topic. why do we need to upgrade the suite? If my machine works well, why should I upgrade it? There are usually three reasons for our upgrade:
· New features are required, but old hosts do not. Therefore, a new suite needs to be installed;
· The old version of the suite may have security concerns, so you need to update it to the new version of the suite;
· The execution efficiency of earlier versions of suites is poor, or the execution capability cannot be satisfied by managers.
In the above requirements, we need to pay special attention to the second point. when a suite has security concerns, do not doubt it. update the suite quickly! Otherwise, it may cause a network Crisis. isn't it a joke? So what are the update methods? In fact, there are many different Update kits in Linux, including the online update mode of RPM and up2date developed by Red Hat; the dpkg method used in distribution of Debian; the pkg upgrade method used in Sun Unix, the more popular online apt update mode, and the most frequently used Tarball compilation method in the original code, if I want to explain it one by one, is it too tiring? Therefore, here we will describe the common RPM and Tarball suite upgrade methods in the Linux distributions such as Mandrake, Red Hat, and OpenLinux:
· RPM
Currently, one of the most widely used suite management programs is to use the database management method to install the suite. it has a very easy operation interface and the suite query and verification function is quite powerful, however, the trouble lies in the dependency of its attributes;
· Tarball
Install the source code directly after compilation. It has great flexibility in installation and can change user-preferred parameters at any time. However, it requires assistance from other kits, such as gcc compiler, kernel-header, and make. In addition, it is difficult for anti-installation;
The two methods have their own advantages and disadvantages. here we want to talk about the installation methods of RPM and Tarball!
RPM kit administrator:
Next, let's talk about the widely used RPM Suite Administrator methods!
· What are RPM and SRPM?
The RPM full name is "RedHat Package Manager! As the name suggests, the suite management program was developed by Red Hat, but many other suites also have similar Suite management programs. However, RPM is easy to use, so it is now the most popular suite management program! So what is RPM? To put it simply, RPM installs the required suite to a set of management programs on your Linux host in a way recorded by the database. Its biggest feature is to package the package you want to install first, and record it through the preset database records in the package, record the dependent attribute modules required for installation of this package (that is, the first few required suites required for your Linux host). when installed on your Linux host, RPM will first query whether the dependency attribute suite of the Linux host meets the requirements according to the records in the suite. If yes, it will be installed. if not, it will not be installed. During the installation, the information of this suite is written into the RPM database for future query, verification, and anti-installation! The advantage is:
1. the installation is convenient because the compilation is complete and the package is complete;
2. the information of the suite has been recorded in the database of the Linux host, which makes it easy to query, upgrade, and reverse install;
But this also caused a lot of trouble, because the RPM program is packed with information, that is to say, the information in it has been "compiled! Therefore, you must first install the host environment at the time of installation. that is to say, the installation environment of this suite must also appear on your host! For example, the rp-pppoe ADSL dial-up kit must be installed in the environment where the ppp suite exists! If your host does not have the ppp suite, we are sorry, unless you first install ppp, rp-pppoe won't let you install it (of course, you can force installation, however, a problem usually occurs !). Therefore, the RPM files released by different distribution cannot be used in other distribution files. for example, the RPM files released by Red Hat cannot be directly installed on Mandrake, what's more, different versions cannot communicate with each other. for example, the RPM file of Mandrake 9.0 cannot be directly applied to version 8.2! As a result, we can find that its disadvantages are:
3. the installation environment must be consistent with or equal to the environment requirements during packaging;
4. the dependency attribute needs to be met;
5. be careful when installing anti-installation. the lowest-level suite cannot be removed first, otherwise it may cause problems in the entire system!
What should we do? Haha! Okay, there's SRPM! What is SRPM? He is also an RPM! However, since both the original code and the original code are included, you can re-compile the code. Generally, the file name of SRPM is ***. src. rpm. Because SRPM contains the original code and parameter setting file, you must re-compile the packaged information file suite before installation! Of course ??? Why? Tomb? Excuse me? Song Shi? Is it easy to move your shirt back to your brain? Too many ?? Scallions? Shi Baday? Why? The biggest difference between running RPM and SRPM is whether there is a program containing the original code!
· What is i386, i586, i686, noarch?
Okay! Now we know the RPM and SRPM formats, respectively:
The format of xxxxxxxxx. rpm <= RPM, the packaged rpm file, and the format of xxxxx. src. rpm <= SRPM, containing the compiled original code information.
·
OK! Is there any version of the rpm file or the name of the suite? Yes, you can look at an rpm file like a rp-pppoe-2.6-5.i386.rpm
Rp-pppoe-2.6-5. i386. rpm the first part is the suite name. this is the suite version information. this is the number of releases. this is the appropriate hardware platform file name.
In this way, you can clearly find the name, version information, number of packages, and operating hardware platform of the suite! Okay. let's talk about each different place:
O Kit name: of course, it is the name of each suite!
O version information: each time a version is updated, a version information is required. Otherwise, how can I know whether the version is new or old? Here, the main version and next version are usually divided. There are many versions!
O release number of versions: that is, the number of compilation times! So why do we need repeated compilation? This is because the same version of the suite may have some bugs or security concerns, so you must reset the set parameters when packaging, after setting, recompile and package it into an RPM file! So there are different packages!
O operating hardware platform: this is a very interesting place, because RPM can be applied to different operating platforms, but the parameters set by different platforms are still different! So the so-called i386, i586, i686 and noarch file names appear!
§ I386: it is applicable to almost all x86 platforms, including the old pentum or the new pentum-IV and K7 series CPUs! That I refers to Intel compatible CPU. as for 386, it is the CPU level!
§ I586: It's a 586-level computer. what is it? CPU levels include the first generation of pentum mmx cpu, AMD K5, and K6 series CPU (socket 7 plug-in;
§ I686: Intel series CPU after pentun II and CPU after K7 all belong to this 686 level!
§ Noarch: there is no hardware level limit.
Note that i386 files can be installed on any machine, whether 586 or 686, but i386 may not be used on 586 or 686 hardware, in addition, i686 files may be better executed on 686 of machines than i386 files! In any case, using i386 should be okay! In addition, because different distirbution environments and function libraries are different, you may also add the abbreviated version of this suite after i386!
Okay! Next, let's talk about the directory to be used during installation!
· Installation directory required for SRPM and RPM
SRPM compilation process:
As mentioned above, some original codes are included in SRPM, so we need to compile and package SRPM! Where is the compilation performed? Because the original code is decompressed during compilation and the parameter control options are also removed at the same time, some materials will appear. where should these materials be stored? You can check in your/usr/src Directory. Generally, the directories provided by each distribution are different. take Mandrake 9.0 as an example, he uses/usr/src/RPM as the working directory, Red Hat uses/usr/src/redhat as the working directory, and Openlinux uses/usr/src/openlinux as the working directory! In any case, it is in the/usr/src directory! Well, since we are in the Mandrake 9.0, go to/usr/src/RPM and have a look:
O/usr/src/RPM/SPEC: the configuration files of the suite are placed in this directory, such as the information parameters and configuration items of the suite;
O/usr/src/RPM/SOURCE: The original file of the suite (* .tar.gz file) and the config file are stored in this directory;
O/usr/src/RPM/BUILD: during compilation, some temporary data will be stored in this directory;
O/usr/src/RPM/RPMS: After compilation and successful compilation, put the packaged files in this directory. There are sub-directories including i386, i586, i686, noarch... and so on.
In addition, unknown errors or set errors may occur during the compilation process. at this time, a corresponding error file will be generated under/tmp, you can perform the debugging based on this error file! After all the problems are solved, the compilation is successful. the files after decompression are in/usr/src/RPM/SPEC, SOURCE, all files such as BUILD will be killed, and only files placed under/usr/src/RPM/RPMS will be left!
RPM installation process:
When RPM is installed, it will first read the set parameter content in the suite, that is, the information we just got in/usr/src/RPM/SPEC! This document is then used to compare the environment of the Linux system. these environments include the precursor suite of the suite to be installed, such as the current postfix e-mail suite, most of them support the identity authentication feature of cyrus-sasl. therefore, to install postfix, you must first install cyrus-sasl. Otherwise, the postfix will not allow you to install cyrus-sasl! There are similar version information, and so on, these are RPM
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.