[Original] talking about the RPM under Linux

Source: Internet
Author: User
Tags rpmbuild

  Although many people now use Yum to replace RPM, RPM has its role in special situations, such as querying and verifying installed RPM packages, rpm full Redhat package Manager, a packaging and installation tool for Internet downloads, It is included in some Linux distributions and it generates a. RPM extension files, similar to dpkg.      RPM's common functions are divided into two chunks:    (1) Check/Verify that the package is installed: rpm {-q|--query} [select-options] [query-options]         (multi-use)                         &NBSP ;                               RPM {-v|--verify} [Select-options] [verify-options]    (2) Install/upgrade/delete Local Packages: rpm {-i|--install} [install-options] package_file ...                             ,         &NB Sp                 RPM {-u|--upgrade} [install-options] package_file ...                                                        RPM {-e|--erase} [--allmatches] [--nodeps] [ --noscripts] [--notriggers] [--test] package_name ...         

Select-options
[Package_name] [-A,--all] [-F,--File file]
[-G,--Group Group] {-P,--package Package_file]
[--fileid ID] [--hdrid SHA1] [--pkgid MD5] [--tid Tid]
[--querybynumber Hdrnum] [--triggeredby Package_name]
[--whatprovides CAPABILITY] [--whatrequires CAPABILITY]

Query-options
[--changelog] [-C,--Configfiles] [-D,--Docfiles] [--dump]
[--filesbypkg] [-I,--info] [--last] [-l,--List]
[--provides] [--QF,--Queryformat queryfmt]
[-R,--requires] [--scripts] [-S,--State]
[--triggers,--triggerscripts]

Install-options
[--aid] [--allfiles] [--badreloc] [--excludepath OldPath]
[--excludedocs] [--force] [-H,--Hash]
[--ignoresize] [--ignorearch] [--ignoreos]
[--includedocs] [--justdb] [--nodeps]
[--nodigest] [--nosignature] [--nosuggest]
[--noorder] [--noscripts] [--notriggers]
[--oldpackage] [--percent] [--prefix NewPath]
[--relocate Oldpath=newpath]
[--replacefiles] [--replacepkgs]
[--test]

Use RPM first determine whether to query, or to install, if you want to query, the general first parameter is-Q, if it is installed, the first parameter is-I, if it is unloaded, the first parameter is-e; then is the next choice: I. Query (List common)-QA: Querying all installed packages-QF: See which package a file belongs to, RPM-QF/ETC/SYSCTL.CONF-QL: View the installation directory for the package-qi: View the standard details of the installed package, such as the size of the package, the installation time, the development group to which it belongs (developm      ENT group), version number and so on. II. Install-I--prefix: Specify the installation path (it is best to specify the installation directory at installation, otherwise the default installation path is very scattered, the executable file is placed by default in the/usr/local/bin library file by default in the/usr/local/lib ... Bad Delete)-I--force: The installation process may appear ". Conflict with ... ", this is the installation process, there may be a file overwrite, which can be used to force overwrite the installation.-IVH: This is the installation of three commonly used parameters, V for the output, h for progress marked with #, RPM-IVH ***.rpmIII. Uninstallrpm-e Package_name If there is a dependency between the package and other installation packages, the uninstallation fails         RPM-E--nodeps package_name no dependency packages          RPM-E--allmatches Package_name Delete all packages that match package_name       Supplemental 1:-v is a generic parameter (General OPTIONS), that is, verbose, that is, query, install, upgrade, This parameter can be added to the unload.       Add 2: When uninstalling packages, if you encounter a dependent package, use--nodeps (don't check dependencies before uninstalling the Packages.), which means that software that uses the software package may not work properly after it is unloaded without checking dependencies.       Add 3: If you encounter a package to install. src.rpm, such packages are RPM packages that contain source code, which need to be compiled at installation:              Method One: (familiar with the compilation process)                ① execution rpm-i your-package.src.rpm   &nbs P            ②cd/usr/src/redhat/specs   (Rpmbuild is used to create RPM packages, which are used to indicate that the converted source code is not compiled into binary files. The default directory under CentOS is/usr/src/redhat)                ③RPMBUILD-BP your-package.specs &NB SP, a specs file with the same name as your package                 ④cd/usr/src/redhat/build/ your-package/ A directory with the same name as your package                 ⑤./configure This step is like compiling common source software, you can add parameters  & nbsp              ⑥make                ⑦make Install     Uninstall (make uninstall)               Method two: (common)   &NBSP ;            ① execution rpm-i you-package.src.rpm             &NBS P  ②cd/usr/src/redhat/SPECS                ③RPMBUILD-BB YOUR-PACKAGE.S Pecs a specs file with the same name as your package                    This time, in/usr/src/redhat/rpm/i386 /(depending on the package, it may be i686,noarch, etc.)   in this directory, there is a new RPM package, which is a compiled binary file.                ④rpm-i new-package.rpm can be installed.

[Original] Introduction to RPM under Linux

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.