Linux Package Management 02-rpm

Source: Internet
Author: User
Tags decrypt gpg

First, RPM package common management commands

1. Installation

A) Rpm-i/path/to/package_file

b)-H: Show progress by #, each # represents 2%;

c)-V: Show detailed procedure

d)-VV: A more detailed process

such as: Rpm-ivh/path/to/package_file

e) rpm-ivh/mnt/centos/zsh-4.2.6-8.el5.i386.rpm

f)--test: Test the installation is normal

g)--nodeps: ignoring dependencies;

h)--replacepkgs: Re-install, replace the original installation;

i)--force: Forced installation (ignoring conflict);

such as: Rpm-ivh--replacepkgs/mnt/centos/zsh-4.2.6-8.el5.i386.rpm

2. Enquiry

A) rpm-q package_name: Query whether the specified package has been installed;

b) Rpm-qa: Query All packages that have been installed;

Example: Rpm-qa | grep "^z

c) Rpm-qi package_name: Query The description information of the specified package;

d) RPM-QL package_name: Query the list of files generated after the installation of the specified package;

e) RPM-QC paceage_neme: Query the configuration file for the specified package installation;

f) RPM-QD package_name: Query the Help file for the specified package installation;

g) rpm-q--scripts package_name: Query the script contained in the specified package;

such as: Rpm-q--scripts zsh

h) Rpm-qf/path/to/somefile: Queries the specified file is generated by which RPM package is installed;

such as: Rpm-qf/etc/inittab

i) if a RPM package has not been installed, we need to query its description information and install the files that will be generated later:

Rpm-qpi/path/to/package_file

Rpm-qpl

3. Upgrade

A) Rpm-uvh/path/to/new_package_file: If the old version is installed, upgrade;

such as: RPM-UVH nano-1.3.12-1.1.1.gls.i386.rpm

b) Rpm-fvh/path/to/new_package_file: If the old version is installed, then upgrade;

c)--oldpackage: Downgrade

Note: The kernel should not upgrade the installation, and the kernel allows multiple versions to coexist. Therefore, you can directly install a number of different versions of the kernel;

4. Uninstall

A) rpm-e package_name

b)--nodeps: ignoring dependencies;

5. Check

Rpm-v package_name: Verify that the installed files are modified;

6. Rebuild the RPM database (/var/lib/rpm), rpm (/var/lib/rpm contains 0 of files named Lock files)

A)--REBUILDDB: Rebuilding the database will definitely be re-established;

b)--initdb: Initialize the database, do not build, there is no need to establish;

7, check the source legality, and package integrity;

A) encryption type:

Symmetric encryption: Encrypt and decrypt using the same key

Public key encryption: A pair of keys, public key, private key, public key is implied in the private key, can be extracted, and publicly out;

One-way encryption: extracting data signature;

If the original data, the results will certainly be the same;

Avalanche effect, the original data is a little different, the results are very different;

b) redhat key file:/etc/pki/rpm-gpg/rpm-gpg-key-redhat-release

c) How to verify the signature (signature): Decrypt the encrypted signature with the official public key, obtain a reliable official signature , and use the same method to extract the signature, and compare and decrypt the signatures of the Code; command:

C1) RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-redhat-release: Import Key file

C2) Rpm-k/papt/to/package_file

DSA, GPG: Verification of the legitimacy of the source, that is, to verify the signature; You can use--nosignature to skip this item;

SHA1, MD5: Verification package integrity, can use--nodigest, skip this;

Second, the RPM package contains the content

1. Files to install

2. Script to execute:

Pre: Represents the script executed before installation

Post: The script to be executed to complete the installation

Preun: Scripts executed prior to uninstallation

Postun: Uninstall complete script to execute

This article is from "Nick Liu's blog," Please make sure to keep this source http://zkhylt.blog.51cto.com/3638719/1426586

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.