Linux Learning notes-the RPM command for package management

Source: Internet
Author: User

Rpm

RPM is a very useful package management Manager in Linux, it has the functions of installing, uninstalling, upgrading, querying, verifying, database maintaining and so on.

Here are the various features of RPM:

Installation:

RPM {-i|--install} [install-options] package_file ...

-V: Detailed display of the installation process

-VV: Relative-V more detailed

-H: Show packages to manage execution progress; Each # represents 2% progress

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AB/wKiom1Xqy-WiMB29AADhEV_wDkY346.jpg "title=" image 001. PNG "alt=" wkiom1xqy-wimb29aadhev_wdky346.jpg "/>

installation process

There are additional options

[Install-options]

--test: Test installation, but do not actually perform the installation process; dry run mode;

--nodeps: Ignoring dependencies;

--replacepkgs: Reinstall;

--nosignature: Do not check the legitimacy of the source;

--nodigest: does not check package integrity;

--noscipts: Do not execute Package script fragment;

%pre: Pre-installation;--nopre

%post: Post-installation script;--nopost

%preun: Unloading the forefoot;--nopreun

%postun: Post-uninstall script;--nopostun

Upgrade:

RPM {-u|--upgrade} [install-options] package_file ...

RPM {-f|--freshen} [install-options] package_file ...

where the-u option is used, an older version of the package is installed, then "Upgrade", or "install" if there is no legacy package;

When the-f option is used, an older version of the package is installed, and the upgrade is not performed if there is no legacy package;

--oldpackage: This option is a downgrade operation;

--force: If you add this option to force the upgrade

Inquire:

RPM {-q|--query} [select-options] [query-options]

[Select-options] Query selection related options

-A: View all packages

-F: To see which package installs the specified file for build

-p/path/to/package_file: Query operation for the package files that have not been installed;

--whatprovides CAPABILITY: Query The specified CAPABILITY is provided by which package;

--whatrequires CAPABILITY: The query specifies which packet the CAPABILITY is dependent on;

[Query-options]

--changelog: Query rpm Package for Changlog

-C: Querying the program's configuration file

-D: Querying the program's documentation

-i:information

-L: View all files generated after the installation of the specified package;

--scripts: Script fragment with package comes in

-r: Query the capability that the specified package depends on;

--provides: Lists the capability provided by the specified package;

Querying the details of a specified program

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AB/wKiom1Xqz5bA5IbNAALuECZmrnk923.jpg "title=" image 002. PNG "alt=" wkiom1xqz5ba5ibnaalueczmrnk923.jpg "/>

Query which package installation builds the specified file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A8/wKioL1Xq0iShLG4CAAA7_5vNsGY477.jpg "title=" image 003. PNG "alt=" wkiol1xq0ishlg4caaa7_5vnsgy477.jpg "/>

Query for all files generated by the specified package installation

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AB/wKiom1Xq0HXgv38uAADR5pYVpFU089.jpg "title=" image 004. PNG "alt=" wkiom1xq0hxgv38uaadr5pyvpfu089.jpg "/>

Querying the program's documentation

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A8/wKioL1Xq0yWS357cAAEhLLTYHgs300.jpg "title=" image 005. PNG "alt=" wkiol1xq0yws357caaehlltyhgs300.jpg "/>

Unloading:

RPM {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers] [--test] package_name ...

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/AB/wKiom1Xq0YWiPWcbAAA5I_lYKdI474.jpg "title=" image 006. PNG "alt=" wkiom1xq0ywipwcbaaa5i_lykdi474.jpg "/>

Check:

RPM {-v|--verify} [select-options] [verify-options]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AC/wKiom1Xq0umjDBWgAAB_9JgFnSs938.jpg "title=" image 007. PNG "alt=" wkiom1xq0umjdbwgaab_9jgfnss938.jpg "/>

After modifying a file, verify the result

The meaning of each field is

S file Size differs

M Mode differs (includes permissions and file type)

5 Digest (formerly MD5 sum) differs

D Device Major/minor number mismatch

L Readlink (2) path mismatch

U User ownership differs

G Group ownership differs

T MTime differs

P capabilities differ

Check the legitimacy of the package to import the required public key, then check the validity of the package

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A8/wKioL1Xq1vriL5E_AACMucc-V4Y823.jpg "title=" image 008. PNG "alt=" wkiol1xq1vril5e_aacmucc-v4y823.jpg "/>

Database rebuild:

RPM {--INITDB|--REBUILDDB}

INITDB: Initialization

If the database does not exist beforehand, it is created; otherwise, no action is taken;

REBUILDDB: Rebuilding

Re-create the database directly, regardless of the current presence or not;


Linux Learning notes-the RPM command for package management

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.