RPM Package Management Basics

Source: Internet
Author: User

rpm Full name RPM Package Manager

1.rpm query for packages

Commonly used are:

Rpm-qa # Lists all the installed rpm Package

Rpm-qi zsh # Enquiry zsh the specific information

rpm-qf/bin/ls# Enquiry /bin/ls which package was released by

RPM-QD zsh # Enquiry zsh What help documents are available

RPM-QC zsh # Enquiry zsh the configuration file address

RPM-QL zsh # Enquiry zsh file paths freed during installation

Less commonly used are:

rpm-q--changelog zsh # Enquiry zsh change history of the software package

rpm-q--requires zsh # Enquiry zsh other packages that depend on

rpm-q--scripts zsh # Enquiry zsh included Scripts "Call these scripts when installing, uninstalling"

In addition, add - P parameters apply to information queries for packages that are not yet installed, such as:

" Note that after adding the- p parameter, it is followed by the full package name "

Rpm-qpi httpd-2.2.15-39.el6.centos.x86_64.rpm # Enquiry httpd detailed information about the software package

Similarly, -QPC , -QPL , -QPD , -QP--changelog are used to query packages that have not yet been installed, you can refer to the above for a variety of scenarios.

2.rpm installation of the package

RPM-IVH xxx.rpm installation XXX Package

RPM-UVH xxx.rpm Upgrade "exists then upgrade, does not exist then this installation"

RPM-FVH xxx.rpm Upgrade "exists then upgrade, does not exist then this time does not install"

RPM-IVH--replacepkgs xxx.rpm Overwrite the installation

RPM-IVH--oldpackage xxx.rpm Downgrade installation rpm Package

There are several optional parameters in the installation process,

--test

such as rpm-ivh--test xxx.rpm indicates that only the package is tested for installation, not physically installed

During installation, if we do not import the public key beforehand, the installation will prompt for a missing checksum or signature. You can add the following options:

--nodigest # do not check package or head check when reading "such as: RPM-IVH--nodigest xxx.rpm "

--nosignature # do not check package or header signature on read

3.rpm uninstallation of the package

rpm-e XXX # Watch this . XXX no need to write a specific xxx.rpm . "Uninstall httpd.2.2.19.rpm, just write rpm-e httpd "

There are also several optional parameters during the uninstallation process.

--nodeps

Such use is not recommended, such as rpm-ivh--nodeps httpd.2.1.3-12.rpm , which indicates that the dependency relationship is ignored.

--test

such as rpm-ivh--test xxx.rpm indicates that only the package is tested for installation, not physically uninstalled

--noscripts indicates no execution rpm It is not recommended to use this parameter for the installation process script.

4.rpm Checksum of the package

The verification package is the information that will be installed on the file, and the data obtained from the package is saved in the rpm The metadata for the file in the database is compared. the checksum of the comparison has the size of each file,MD5 checksum, license, type, owner. Any wrong places are shown back.

rpm-v zsh # Checksum zsh Package " zsh is Installed "

Rpm-va # verify files for all installed packages " MD5 "

rpm-vf/bin/ls# Checksum /bin/ls file " MD5 Information "

The check gives the following information:

C%config configuration file

D%doc Document

g%ghost Placeholder Documents ( that is, the contents of the file are not included in the package valid content )

L%license license File

R%readme description File

S file Size Inconsistent size

M Mode Pattern Inconsistency ( including license and file type )

5 MD5 sum Checksum inconsistency

D Device master and slave device numbers do not match

L Readlink (2) Path mismatch

U User Principal inconsistency

G Group Group owner inconsistency

T MTime inconsistent time

For example, verify all package files that are installed in the system:

650) this.width=650; "title=" 1.png "src=" Http://s3.51cto.com/wyfs02/M01/72/62/wKioL1XimjPRvAmtAACZzR2y3D8911.jpg " alt= "Wkiol1ximjprvamtaaczzr2y3d8911.jpg"/>

rpm Validation of package source legitimacy

typically used to verify a newly downloaded package MD5 value using

RPM--import/path/from/gpg-pubkey-file

For example: rpm-k zsh-4.3.10-7.el6.x86_64.rpm

prompt as follows, Zsh-4.3.10-7.el6.x86_64.rpm:rsa SHA1 (MD5) PGP MD5 OK

5.rpm Database Rebuild

rpm--initdb # Initialize rpm Database

rpm--REBUILDDB # Regenerate rpm Database

There may be imperfections in the area, to be added.

RPM Package Management Basics

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.