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