What is RPM?

xiaoxiao2021-03-06  28

Silverwolf

At present, one of the most widely used suite management programs, using the database management method to install the kits, with fairly easy operating interface, and the functions of the suite query verification are quite powerful, but the trouble is in his property dependence ;

What is RPM, SRPM? RPM full name is "Redhat package manager" is RPM! As the name suggests, the program of this suite management is developed by Red Hat, but in fact, there are also similar kits management programs in many other suites. However, because RPM is very convenient, it has become the current most popular suite management program! So what is RPM? Simple, RPM is a set of managed programs that you need to be required in a way in a database record. His biggest feature is to first package the kit you want to install first. Record the propositions of this kit to install this suite (you are your Linux host) There are several must-have to exist first). When installing your Linux host, RPM will first query the LINUX host's dependent property suite in the suite, if you meet, if you don't satisfy it, Install. So when you install, you will write the information of the kit entirely into the RPM database so that future queries, verification and reverse installation! This advantage is that since it has been completed and packaged, it is easy to install; because the information of the kit has been recorded on the LINUX host's database, it is easy to query, upgrade and reverse installation; but this is also Big trouble, because the RPM program is a packaged information, that is, the information inside has already "compiled"! Therefore, it is necessary to install the host environment when installing can be installed, that is, the installation environment of establishing this kit must also have only played on your host! For example, RP-PPPoE This ADSL Dial Kit, he must install in the environment where PPP is exist! If your host doesn't have a PPP suite, then I am sorry, unless you install the PPP or RP-PPPoe is not to install (of course you can force the installation, but usually a little problem is!). Therefore, the RPM files released by different distribution are not available in other distribution, for example, the RPM files released by Red Hat, usually unable to install directly on the Mandrake, more, different There is also an interworking between the versions, such as the RPM file of Mandrake 9.0, can not be used directly on 8.2! Therefore, this can be found that his disadvantage is that the installed environment must be consistent with the environmental demand at the time of packaging; it is necessary to meet the dependence of the kit; especially careful, the bottom-level kit can not be removed, otherwise it may Problem in the entire system! What should I do? Ha ha! Fortunately, there is SRPM this thing! What is SRPM? He is also a RPM! However, due to the original code before the initial compilation, it can be recompiled. Usually the attachment name of SRPM is ****. Src.rpm This archive format.

Since SRPM contains the original code and parameter setting file, it must be re-compiled before installing the packaged information file suite! Of course, Luo, if you have problems in the process of compilation, you can also correct the problem with the original code of the head! Therefore, the biggest difference between RPM and SRPM is that there is no program that contains the original code! -------------------------------------------------- ------------------------------

What is i386, i586, i686, noarch is ok! Now we already know that the RPM and SRPM format are: xxxxxxxx.rpm <== RPM format, the RPM file that has been completed; xxxxx.src.rpm <== SRPM format, including original code information for compilation . OK! So is there any version of the RPM file or the name of the suite name? Yes, you can look at an RPM file, such as rp-pppoe-2.6-5.i386.rpm rp-pppoe - 2.6 - 5. I386.rpm The first part is the set of suite this is the version of the suite This is the number of times the publication. This is a suitable hardware platform attached name, which can be clearly discovered to discover the name, version information, packages of the package and the hardware platform of the operation! Ok, let's talk about each different place: Suite name: Of course, the name of each suite! Version Information: Every update version needs to have a version of information, otherwise how to know this version is old? Here is usually divided into a main version with a second, anyway, there are a lot of versions! Release publication: That is, the number of compilation! So why do you need repeated compilation? This is because of the same version of the kit, it may be necessary to reset the setting parameters when the package is reset must be reset, and then recompile and package it into the RPM file! Therefore, there is a different number of packages! Hardware platform: This is a very fun place, because RPM can apply on different operational platforms, but due to different platforms set parameters! Therefore, there is a so-called I386, I586, I686, and NOARCH, etc.!

i386: Almost suitable for all X86 platforms, whether old Pentum or new Pentum-IV and K7 series of CPUs, can work fine! That i refers to Intel's meaning, as for 386, it is the level of CPU! I586: Is the 586 grade computer, what is it? Including the CPU of the Pentum first-generation MMX CPU, AMD's K5, K6 series CPU (Socket 7 pins), etc. Is this level;

I686: The Intel series CPU after Pentun II, and the CPU of the grade after K7 belongs to this 686 level! NOARCH: There is no limit on any hardware level. Additionally, the file of i386 can be installed on any machine, whether it is 586 or 686 machine, but i386 may not necessarily use the hard body of 586 or 686, in addition, on the machine of 686 The files using I686 will be better than the files that use I386, the performance may be better! Anyway, using i386 should be more no problem! In addition, since different DistirButions will have different environments and fipment libraries, it is also possible to add an extra shorthand of this kit after I386! All right! Next, let's talk about the directory you need to use! The compilation process of the installation directory SRPM required when SRPM is working with RPM: Just mentioned that the SRPM contained in the uncharacted original code, so we need to compile SRPM to the package! So where is the compilation? Since the original code is unfained due to compilation, and the accompanying parameter control options are also unlocked, so some information will appear, then where is these information? You can go to your / usr / src in this directory to see, usually the directory provided by each Distribution is not the same, take Mandrake 9.0 as an example, he is a work directory with / usr / src / rpm, Red Hat is With / usr / src / redhat as a work directory, OpenLinux is a work directory with / usr / src / OpenLinux! Anyway, anyway, it is right in / usr / src. Ok, since we are in Mandrake 9.0, then go to / usr / src / rpm to see: / usr / src / rpm / spec: This directory is placed in the set file, for example this The information parameters, setting items, etc. of the kit are all placed here; / usr / src / rpm / source: This directory is placed in the original file of the suite (* .tar.gz file) and config setting file ; / Usr / src / rpm / build: Some temporary materials are placed in this directory during the compilation process; / usr / src / rpm / rpms: After compiling, and after successful compilation, will package The completed file is placed in this directory. There is a second directory containing I386, i586, i686, noarch ..., and so on.

In addition, in the compilation process, an unknown error may occur, or the set error, this time, a corresponding error file is generated under the / TMP, you can make the wrong job according to the error file ! After all the questions are solved, it is also completed, then the file after I just decompressed, that is, the files in / usr / src / rpm / spec, source, build, etc. will be killed, and only place it. / USR / SRC / RPM / RPMS under the file! RPM installation process: RPM When installing, you will go to read the setting parameters in the suite, just we have related information in / usr / src / rpm / spec! The information is then used to compare the environment of the Linux system. These environments include the front drive kits of this kit, for example, the current Postfix this E-mail kit, mostly supports the identity authentication function of the Cyrus-SASL suite, so To install postfix, you must first install the Cyrus-SASL set, otherwise postfix will not let you install! There are also similar versions of information, etc. These are the requirements of the RPM environment. If the environment is configured, it will be installed. If you do not match, you will show the content that does not meet! After the installation is complete, RPM will write the information of the suite: / var / lib / rpm! So, when you are inquiring or expected to upgrade, the relevant information will be provided by the content information of / var / lib / rpm this directory! In addition, when installing the RPM kit, these kits typically use directory: / etc Some directory placed, such as / etc / samba / usr / bin Some executable file / usr / lib Some programs Dynamic Funition Library / USR / Share / DOC Some basic Software User Manuals and Description Auto / USR / Share / Man Some Man Page Archives Let's take the instructions for RPMs. -------------------------------------------------- ------------------------------

RPM instructions: installation, upgrade, and update, query, verification, anti-installation and reconstruction database RPM provides "Installation", "Upgrade and Update", "Query", "Verification", "Reverse Installation and Reconstruction Database" Waiting for the function, let's explain one by one!

-------------------------------------------------- ------------------------------

Installation: It is installed from nothing! So why? If RPM is used, IVH is used! If you are SRPM, use Rebuild or Recompiler Luo! [root @Test / root] # rpm --Rebuild rp-pppoe-2.6-5.src.rpm <== srpm [root @test / root] # rpm - Recompile rp-pppoe-2.6-5.src.rpm <== SRPM [root @test / root] # rpm -ivh rp-pppoe-2.6-5.i386.rpm <== rpm --rebuild: This parameter will "compile" and "package" Action, but not installed, when you use -Rebuild, you will usually find a line of fonts: wrote: /usr/src/rpm/rpms/i386/rp-pppoe-2.6-5.i386.rpm This is compiled Completed RPM Archive! Then this file can be used to install! Please add a absolute path when installing! - Recompile: This action will directly "compile" "package" and "install" Luo! Please note that Rebuild is only "compiled and packaged", and Recompile not only compiles with packaging, but also "installation"! -IVH: It is used to install the parameters of RPM and under this parameter, because there will be some "dependent attributes" issues, or the problem that has been installed, you can "mandate" Installation: --Nodeps: Do not consider the relationship of dependent attributes, give him a mandatory installation; --Replacepkgs: If you have installed this kit, you want to overwrite this kit, then you don't need to install it, you can add it directly. On -ReplacePkgs forced overwriting; --ReplaceFiles: After this suite is installed, it has been modified by you? Is "confilcting files" in the installation process, then remove this file directly to --ReplaceFiles! [root @Test / root] # rpm -ivh rp-pppoe-2.6-5.i386.rpm [root @Test / root] # rpm -ivh - nodeps rp-pppoe-2.6-5.i386.rpm <== Do not consider the dependent module [root @test / root] # rpm -ivh - rereplacepkgs rp-pppoe-2.6-5.i386.rpm <== directly overwrite the installed suite [root @test / root] # rpm -IVH --ReplaceFiles rp-pppoe-2.6-5.i386.rpm <== Directly overwrite the modified problem file ---------------------------------------------------------------------------------------------------------------- -------------------------------------------------- ------------

Upgrade: Upgrade using rpm is too simple! Take UVH to upgrade! However, in a large number of upgraded versions, it is a better practice using FVH. However, it is important to note that if you use FVH, there is no such kit on your machine, so I am sorry, this kit will not be installed on your Linux host, so please re-install it. ! [root @Test / root] # rpm -uvh rp-pppoe-2.6-5.i386.rpm [root @Test / root] # rpm -fvh * .rpm <== all installed on your Linux host Upgrading Note is that UVH is an upgrade that you are using, as for FVH, "So only the kit exists in your system", so some friends are in a large number of suite version, they are all like this. Do: First come to the Errata website of each developer to catch up with the latest i386 file; use -fvh to fix and upgrade the suite installed in your system! (It is convenient!) -------------------------------------------- ------------------------------------

Query: Query is also one of the important features of RPM, because he provides the version of this kit, useful information, etc., is quite useful! So how do you query? Under the bottom, as long as the query parameter: 1. From the system query (information obtained from / var / lib / rpm database) [root @Test / root] # rpm -q rp-pppoe <== list only RP-PPPoE The version of this kit; [root @Test / root] # rpm -qa <== lists all installed kits and versions; [root @Test / root] # rpm -qi rp-pppoe <== list RP- PPPOE's detailed information [root @Test / root] # rpm -ql rp-pppoe <== lists the files and paths for RP-PPPoE installation; [root @Test / root] # rpm -qf / etc / Rc.d / init.d / pppoe <== Query PPPOE This file belongs to which kit? 2. The content of the file query file [root @Test / root] # rpm -qpi rp-pppoe-2.6-5.src.rpm <== querying this kit detailed information; [root @Test / root] # rpm - QPL RP-PPPOE-2.6-5.src.rpm <== Query how much file content exists in this kit: Query the installed suite can use -q to know his suite version, but if you forget the kit Full name, you can use rpm -qa | grep pakagename to select the appropriate suite! If you use -QI, you can understand the main information of this suite! Look for suitcase: often we forget the files containing a set of suite, you can use -QL to query the kit, will list quite a few files! Looking for a kit by the archive: This is the longest problem, that is, you "misunderstand" a file, I don't know which kit he is, huh! Then you can use the friend of the same system, use -QF to query the suite to which the file belongs, and then reinstall the kit will come back! -------------------------------------------------- ------------------------------

Verification: The function of the verification is mainly providing a useful management mechanism for system administrators! The way the way is to "use the content of the database under / var / lib / rpm to compare all the suite files in the environment of the current Linux system" that is, when you have information, you are not careful, or because you misunderstand some The file of a set, or accidentally do not know the file content of a certain kit, use this simple method to verify the original file system! It's so letting you understand which file information is modified! [root @Test / root] # rpm -v rp-pppoe <== Single Check RP-PPPoe file content with the original file content and original [root @Test / root] # rpm -va <== Check all / VAR / LIB / RPM under the database and the same file under the Linux system! Example: [root @Test / root] # rpm -v xinet s5 .... t c /etc/xinetd.d/ecHo S.5 .... T c /etc/xinetd.d/echo-udp S.5 .... t c /etc/xinetd.d/time s.5 .... t c /etc/xinetd.d/time-UDP instructions in front of the file name S: File Size Differs The capacity size has been changed) M: Mode Differs (Include Permissions and File Type) (the properties of the file, if the parameters of the file have been changed) 5: MD5 SUM DIFFERS (MD5 encryption The attribute has been changed) D: Device Major / minor Number Mis-match (the device name has been changed) L: readlink (2) path Mis-match (the link attribute has been changed) u: User Ownership Differs (the person of the file Has been changed) G: Group Ownership Differs (the group of files of the file has been changed) T: Mtime differs (the settling time of the file has been changed)

[root @ Test RPM] # rpm -ql crontabs <== What files do you have in crontabs? /etc/cron.daily /etc/cron.Hourly /etc/cron.monthly /etc/cron.warekly / etc / crontab [root @ test rpm] # rpm -v crontabs <== What have been modified? ? S.5 .... T C / ETC / CRONTAB, for example, in the example, we know that crontabs have five files or directories, where it is verified, it will find / etc / crotab has been changed? So If the file changes are "expected", there is no big problem, but if the file is "non-expected", is it invaded? Ha ha! Pay attention to Luo! -------------------------------------------------- ------------------------------ Anti-installation and reconstruction database: The anti-installation is to release the kit! It should be noted that "the process of solving the installation must be released from the top to bottom", as an example of RP-PPPoE, this kit is mainly based on PPP, so when you want to release the PPP, I must first release the rp-pppoe! Otherwise, there will be a structure problem! This can be explained by the building. If you want to remove the five or six floors, then you have to take the sixth floor, otherwise you will be dismantled, then the top floor will happen? So reconstruction of the database? Since we will have been modifying some file content, such as the parameter file in /etc/xinetd.d, plus actions that may be added, removed from the process of system operation, resulting in a bit chaos of the system, this You can use -rebuilddb to rebuild the RPM database! The parameters of these two methods are as follows [root @Test / root] # rpm -e re-pppoe <== Solution RP-PPPOE [root @test / root] # rpm --rebuilddb <== Rebuild database

转载请注明原文地址:https://www.9cbs.com/read-81560.html

New Post(0)