RPM is a RedHat Package Manager (RedHat Package management tool) similar to "Add/delete programs" in Windows"

Source: Internet
Author: User

RPM is a RedHat Package Manager (RedHat Package management tool) similar to "Add/delete programs" in Windows"
Rpm executes the installation package Binary Package (Binary) and Source package (Source. The binary package can be directly installed on the computer, and the source code package will be automatically compiled and installed by RPM. Source code packages often use src. rpm as the suffix. Common command combination:-ivh: installation shows the installation progress -- install -- verbose -- hash-Uvh: upgrade package -- Update;-qpl: listing the file information in the RPM Package [Query Package list];-qpi: listing the description of the RPM package [Query Package install Package (s)];-qf: find the RPM package of the specified File [Query File];-Va: Check all RPM packages and find the missing File [View Lost];-e: delete package rpm-q samba // check if the program has rpm-ivh/media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm // install by path and display progress rpm-ivh -- relocate/= /opt/gaim gaim-1.3.0-1.fc4.i386.rpm // specify the installation directory rpm- Ivh -- test gaim-1.3.0-1.fc4.i386.rpm // used to check dependencies; not a real installation; rpm-Uvh -- oldpackage gaim-1.3.0-1.fc4.i386.rpm // The new version is downgraded to the old version rpm-qa | grep httpd # [search for whether the specified rpm package is installed] -- all search * httpd * rpm-ql httpd #[ search rpm packages] -- list all File Installation directories rpm-qpi Linux-1.4-6.i368.rpm # [view rpm packages] -- query -- package -- install package info rpm-qpf Linux-1.4-6.i368.rpm # [view rpm packages] -- filerpm -qpR file. rpm # [View package] dependency rpm2cpio file. rpm | cpio-div # [Extract files] rpm-ivh fi Le. rpm # [install new rpm] -- install -- verbose -- hashrpm-ivh rpm-Uvh file. rpm # [upgrade an rpm] -- upgraderpm-e file. rpm # [delete an rpm package] -- Common erase parameters: Install/Upgrade/Erase options:-I, -- install package (s)-v, -- verbose provide more detailed output-h, -- hash print hash marks as package instils (good with-v)-e, -- erase (uninstall) package-U, -- upgrade = <packagefile> + upgrade package (s) -- replacepkge no matter whether the package has Install the software package-test installation test, not actually installed -- nodeps ignores dependencies of software packages forcibly installed -- force ignores conflicts between software packages and files Query options (with-q or -- query):-, -- all query/verify all packages-p, -- package query/verify a package file-l, -- list files in package-d, -- docfiles list all documentation files-f, -- file query/verify package (s) owning file RPM source code package installation. src. rpm-end files that are packaged from the software's source code. to install such RPM packages, you must use the command: rpm -- recompile vim-4.6-4.src. Rpm # This command unpacks the source code and compiles and installs it if the user uses the command: rpm -- rebuild vim-4.6-4.src.rpm # After the installation is complete, the compiled executable files will be repackaged into an i386.rpm RPM package. I do not like to write complicated things. If you are in trouble, 'but as a reference,' I also switched to a cool man's 'write really comprehensive' Author: north, south, and south from: linuxSir. org Abstract: RPM is the abbreviation of Red Hat Package Manager. It was originally intended to be the management of Red Hat software packages. This article introduces RPM and describes applications such as manual installation and query of RPM Based on instances; ++ ++ body: ++ ++ RPM is the abbreviation of Red Hat Package Manager, the intention is to manage the Red Hat software package. As the name suggests, it is the software package management contributed by Red Hat; In Fedora, Redhat, Mandriva, SuSE, YellowDog, etc. Mainstream Release versions, as well as the secondary development of Release versions based on these versions; what are included in the RPM package? There are other files in addition to the license file. Applications in an RPM package sometimes require files of other specific versions in addition to the additional files they carry to ensure their normality, this is the dependency of the software package. The dependency is not exclusive to Linux and exists in Windows. For example, when we run 3D games in Windows, he may prompt that you want to install Direct 9. the Linux and Windows principles are similar. Software Installation flowchart: the scope of this article is: 1. This document describes the rpmmanaged software, and make is used for the file.tar.gz or file.tar.bz2 source code package; make install software is not valid; 2. When installing software, it is best to use the system software provided by their respective releases. Package management tool. For Fedora/Redhat, you can refer to the following articles; 1) Fedora system management software package Tool system-config-packages to conveniently add and remove software packages provided by system installation disks, for details, see Fedora Software Package Manager system-config-packages 2) Redhat system management software package tool. The new system should be redhat-config-packages, the usage is the same as that of Fedora Software Package Manager system-config-packages. 3) Online installation, removal, and upgrade of apt + synaptic software package. Usage: install or upgrade Fedora core 4.0 software package online with apt + synaptic 4) install, upgrade, and remove tools online using the yum software package. Usage: Install and update the software package online with Fedora/Redhat, yum (5) All yum and apt tutorials apt and yum currently Apt and yum are very mature. We recommend that you use apt or yum when installing the software. If you install the software package provided by the system disk, you can use system-config-packages or redhat-config-packages; i. Usage of RPM package management; 1. software can be installed, deleted, upgraded, and managed; of course, software can also be installed and upgraded online; 2. You can use RPM to check which files are included in the software package and which software package the file belongs to. 3. You can check whether the software package in the system is installed and its version; 4. As a developer, You can package your program into an RPM package and release it. 5. Import, verify, and publish the software package signature GPG and MD5. 6. Check dependencies, check whether any software package is incompatible with the system; 2. RPM permission; only root permission is required for installation, deletion, and update of RPM software; any user can operate on the query function. If a common user has the permission to install the directory, the user can also install it. 3. A simple usage of rpm; apart from In addition to the Software Package Manager, the rpm command can also be used for installation. Can all software packages be installed through the rpm command? No, the file uses. the rpm suffix ends. Sometimes we find file on some websites. (1) initialize the rpm database. Run the rpm command to check whether an rpm package is installed; therefore, we often need to use the following two commands to initialize the rpm database; [root @ localhost beinan] # rpm -- initdb [root @ localhost beinan] # rpm -- rebuilddb note: this takes a long time. Note: These two parameters are extremely useful. Sometimes the rpm system has a problem and cannot be installed or queried. Most of them have a problem here. II) query function of RPM software package management: Command Format: rpm {-q | -- query} [select-options] [query-options] the query function of RPM is extremely powerful, is one of the most important functions. For more details, refer to # man rpm 1. Query installed software; 1) query system installed software; Syntax: rpm-q software name example: [root @ localhost beinan] # rpm-q gaimgaim-1.3.0-1.fc4-q is -- query, this command indicates whether gaim is installed in the system. If gaim is installed, information is output. If gaim is not installed, information about gaim is not installed; to view all installed packages in the system, add the-a parameter; [root @ localhost RPMS] # rpm-qa, add a pipeline | and more commands; [root @ localhost RPMS] # rpm-qa | more searches for a software in all installed software packages, such as gaim. It can be extracted using grep; [root @ localhost RPMS] # rpm-qa | the above function of grep gaim is the same as the output of rpm-q gaim. (2) query the software package of an installed file. Syntax: rpm-qf file name note: the absolute path of the file name should be pointed out as an example: [root @ localhost RPMS] # rpm-qf/usr/lib/libacl. lalibacl-devel-2.2.23-83) queries where installed software packages are installed; Syntax: rpm-ql software name or rpm rpmquery-ql software name example: [root @ localhost RPMS] # rpm-ql lynx [root @ localhost RPMS] # rpmquery-ql lynx4) Query Information syntax format of an installed software package: rpm-qi software name example: [root @ localhost RPMS] # rpm-qi lynx5) Check the configuration file of the installed software. Syntax format: rpm-qc software name example: [root @ localhost RPMS] # rpm-qc The syntax format: rpm-qd software name example: [root @ localhost RPMS] # rpm-qd lynx7) check the software packages and files on which the installed software depends. Syntax format: rpm-qR software name example: [root @ localhost beinan] # rpm-qR rpm-python query Summary of installed software: if a software package has been installed, we can combine a series of parameters, such as rpm-qil. For example: [root @ localhost RPMS] # rpm-qil lynx 2. View uninstalled software packages only if you have one. rpm files, that is, files for existing software. (1) view the purpose and version of a software package. Syntax: rpm-qpi file. rpm example: [root @ localhost RPMS] # rpm-qpi lynx- 2.8.5-23. i386.rpm2) view the files contained in a software package. Syntax: rpm-qpl file. rpm example: [root @ localhost RPMS] # rpm-qpl lynx-2.8.5-23.i386.rpm3) view the location of the software package documentation; Syntax: rpm-qpd file. rpm example: [root @ localhost RPMS] # rpm-qpd lynx-2.8.5-23.i386.rpm5) view the configuration file of a software package; Syntax: rpm-qpc file. rpm example: [root @ localhost RPMS] # rpm-qpc lynx-2.8.5-23.i386.rpm4) view the dependency Syntax of a software package: rpm-qpR file. rpm example: [root @ localhost archives] # rpm-qpR yumex_0.42-3.0.fc4_noarc H. rpm/bin/bash/usr/bin/pythonconfig (yumex) = 0.42-3.0.fc4pygtk2pygtk2-libgladerpmlib (CompressedFileNames) <= 3.0.4-1 rpmlib (PayloadFilesHavePrefix) <= 4.0-1 usermodeyum> = 2.3.2 3) install, upgrade, and delete the software package; 1. Install and upgrade an rpm package; [root @ localhost beinan] # rpm-vih file. rpm note: this is used to install a new rpm package. [root @ localhost beinan] # rpm-Uvh file. rpm note: this is used to upgrade an rpm package. If there is a dependency, please solve the dependency. In fact, the software package manager can solve the dependency well. Please refer to the previous introduction of the Software Package Manager; if you cannot find the dependency package in the package manager The dependency can only be solved by compiling the packages it depends on, or forced installation. syntax structure: [root @ localhost beinan] # rpm-ivh file. rpm -- nodeps -- force [root @ localhost beinan] # rpm-Uvh file. rpm -- nodeps -- force for more parameters, please refer to the example application of man rpm: [root @ localhost RPMS] # rpm-ivh lynx-2.8.5-23.i386.rpmPreparing... ######################################## ### [100%] 1: lynx ####################################### #### [100%] [root @ localhost RPMS] # rpm-ivh -- replacepkgs lynx -2.8.5-23. i386.rpmPreparing... ######################################## ### [100%] 1: lynx ####################################### #### [1, 100%] Note: -- replacepkgs parameters are re-installed with installed software. Sometimes there is not much need; test and installation parameters -- test are used to check dependencies; they are not truly installed; [root @ localhost RPMS] # rpm-ivh -- test gaim-1.3.0-1.fc4.i386.rpmPreparing... ######################################## ### [100%] downgrade from the new version to the old version, to add the -- oldpackage parameter; [root @ localhost RPMS] # rpm -Qa gaimgaim-1.5.0-1.fc4 [root @ localhost RPMS] # rpm-Uvh -- oldpackage gaim-1.3.0-1.fc4.i386.rpmPreparing... ######################################## ### [100%] 1: gaim ####################################### #### [100%] [root @ localhost RPMS] # rpm-qa gaimgaim-1.3.0-1.fc4 specifies the installation directory for the package: to add the-relocate parameter; The following example is to install the gaim-1.3.0-1.fc4.i386.rpm specified in the/opt/gaim directory; [root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/gai M gaim-1.3.0-1.fc4.i386.rpmPreparing... ######################################## ### [100%] 1: gaim ####################################### #### [100%] [root @ localhost RPMS] # ls/opt/gaim specifies the installation directory for the software package: to add the-relocate parameter; The following example is to install the lynx-2.8.5-23.i386.rpm specified in the/opt/lynx directory; [root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/lynx -- badreloc lynx-2.8.5-23.i386.rpmPreparing... ###################################### ##### [100%] 1: lynx ####################################### #### [100%] How do we call a program installed in a specified directory? Generally, the execution programs are stored in the bin or sbin directory of the installation directory. Take a look at the example below. If there is an error output, make the corresponding link and use ln-s; [root @ localhost RPMS] #/opt/lynx/usr/bin/lynxConfiguration file/etc/lynx. cfg is not available. [root @ localhost RPMS] # ln-s/opt/lynx/etc/lynx. cfg/etc/lynx. cfg [root @ localhost RPMS] #/opt/lynx/usr/bin/lynx www.linuxsir.org 2. delete an rpm package. First, you must learn to query the rpm package. See the previous instructions; [root @ localhost beinan] # rpm-e package name example: If I want to remove the lynx package, the complete operation should be: [root @ localhost RPMS] # r If pm-e lynx has a dependency, you can also use -- nodeps to ignore the dependency check to delete it. But do not do this as much as possible. It is best to use the software package manager systerm-config-packages to delete or add software; [root @ localhost beinan] # rpm-e lynx -- nodeps 4. Import signature: [root @ localhost RPMS] # example of rpm -- import signature file: [root @ localhost fc40] # rpm -- import RPM-GPG-KEY [root @ localhost fc40] # rpm -- import RPM-GPG-KEY-fedora the RPM signature function, for details, see man rpm 5. The RPM Management Package Manager supports network installation and query. For example, we want to query and install software packages through an image of Fedora Core 4.0. Address: http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/example: Command Format: the http or ftp address of the rpm parameter rpm package file # rpm-qpi http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm # rpm-ivh http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm; 6. A little supplement to the query of installed software packages; [root @ localhost RPMS] # updatedb [root @ localhost RPMS] # The locate software name or file name uses updatedb. We can use locate to query where some software is installed; the system needs to execute updatedb for the first time and run it at intervals to keep the installed software library up-to-date. updatedb is owned by the slocate software package. If you do not have this command, you need to install slocate; example: [root @ localhost RPMS] # locate gaim 7. Extract files from the rpm package. Command Format: rpm2cpio file. rpm | cpio-div example: [root @ localhost RPMS] # rpm2cpio gaim-1.3.0-1.fc4. I 386. rpm | the files extracted from cpio-div are stored in usr and etc in the operating directory. In fact, it is better to specify the installation directory to install the software; you can also Extract files; specify the installation directory for the package: add the-relocate parameter; the example below is to specify the gaim-1.3.0-1.fc4.i386.rpm to install in the/opt/gaim directory; [root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/gaim gaim-1.3.0-1.fc4.i386.rpmPreparing... ######################################## ### [100%] 1: gaim ####################################### #### [100%] [root @ localhost RPMS] # ls/opt/gaim It can also be clear at a glance; All gaim files are installed in/opt/gaim. We just need to back up the gaim directory and then unload the gaim; this is actually a usage of extracting files; 8. RPM configuration file; RPM package management, the configuration file is rpmrc, which we can find in our own system; for example, the rpmrc file in Fedora Core 4.0 is located; [root @ localhost RPMS] # locate rpmrc/usr/lib/rpm/redhat/rpmrc can be viewed through rpm -- showrc; we have to learn the specifics by ourselves. Oh... Don't ask me, I don't understand either. As long as you read this article and think it is useful to you, your level is similar to mine. Our level is the same, so I cannot help you. Please understand; 9. src. rpm usage: file. src. introduction to rpm usage: package management in the ora/Redhat getting started tutorial, I have already written a lot; at present, there is still a lack of my methods to install software through the source code package and a summative document; I want to complete these two articles in the last two days, which I have previously written; I just need to repeat it and paste it out. At my level, it is extremely effort-consuming to write the ora getting started tutorial. It can only be improved and supplemented at 1.1 points; the tutorial I wrote is intended for beginners who do not know anything about Linux. The examples and applications in the tutorial account for the majority. If I find that there are no instances, it is better for beginners to see man. I can see man, of course, it is not a newbie. I often read some questions from some brothers on the Forum. Although I can handle them in the past, it is better to write a system getting started tutorial to make it easier for everyone; although it takes a little longer;

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.