Use of the RPM command in CentOS

Source: Internet
Author: User

Although now more than n people use Yum to replace the rpm, but rpm in some special occasions still have its role, such as query and verify the installed RPM package, RPM full Redhat package Manager, is a packaging and installation tools for packages, It is included in some Linux distributions and it generates a. RPM extension files, similar to dpkg.

1. Install the Package

RPM-IVH ***.rpm where I means installation, V for output, h for progress marking with #

2. Upgrading packages

RPM-UHV ***.rpm

3. Removing packages

RPM-E package_name

Rpm-e–nodeps Package_name does not consider dependency packages

Rpm-e–allmatches package_name Remove all packages that match all versions of Package_name

4. Querying packages

Rpm-q package_name

RPM-QP ***.rpm get information about RPM packages in the current directory

Rpm-qa | Less lists all installed packages

Rpm-qf/etc/sysctl.conf to see which package a file belongs to

Rpm-qi package_name lists the standard details of the installed package

RPM-QLP package_name List the file contents of RPM Package

Rpm-q–scripts Kernel | Less lists pre-and post-installation scripts with installed RPM packages

Rpm-qa–queryformat ' Package%{name} is build on%{buildhost}\n ' | Less Queryformat powerful queries

Rpm–querytags | Less can list all the variables that Queryformat can use to combine into a more powerful query

5. Check the installed packages

Rpm-va | grep bin

Check for failed characters:

S: File size does not match, M: mode does not match, 5:MD5 Checksum does not match, U: User ownership does not match, G: User group ownership does not match, T:mtime does not match

6. Rebuilding the RPM database

rm/var/lib/rpm/__db.00*

Rpm–rebuilddb Use this Dafa when the RPM database is corrupted and the package cannot be installed

7. Extracting files from rpm

Rpm2cpio ***.rpm | CPIO-IDV/path/file name


Use of the RPM command in CentOS

Related Article

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.