RPM Introduction:
RPM, called Redhat Package Manager, is a software management mechanism developed by Red Hat from SuSE.
RPM Features:
RPM is installed after it is compiled and packaged into an RPM file. RPM has a feature: when the software is to be installed in RPM, RPM checks to see if those interdependent programs are installed on the Linux database and cannot be installed if the database displays dependent software with default. The dependency of the package needs to be resolved, then the RPM file can be installed on the Linux system. The relevant information is written after the installation is completed/var/lib/rpm
The name format of the RPM package:
zsh-5.0.27.e17_1.2.x86_64.rpm
name-version-arch.src.rpm
Name: The software is generally named, such as the zsh of the above example
Version: Major version. Minor version. Revision number-release version number 5.0.27-e17,el*: Represents the Publisher version of this package, EL7 indicates that the package is used in Rhel 7.x/centos 7.x.
Arch: Supported platform x86 presentation platform
src.rpm or RPM:. RPM is a binary package that has been compiled and can be installed directly with the RPM command. SRC.RPM is the source code, need to be compiled to install after
2, Devel: Indicates that this package is a development package.
3, Noarch: that such a package can be installed on any platform, on any hardware platform can be shipped.
4, manual manual document.
RPM Installation:
RPM {-i|--install} [install-options] package_file ...
-I: Indicates RPM installation
-V View the progress of the installation process
-VV See the installation process in more detail
-H shows the progress bar of the installation process
[Email protected] mnt]# RPM-IVH zsh-5.0.2-14.el7.x86_64.rpm warning:zsh-5.0.2-14.el7.x86_64.rpm:header V3 RSA/SHA256 Signature, key ID f4a80eb5:nokeypreparing ... ################################# [100%]package zsh -5.0.2-14.EL7.X86_64 is already installed
Additional Options for RPM installation:
--nodeps: To ignore dependencies, when the software is dependent on each other and can not be installed when the installation of the option to be installed, it is best not to use, may cause the post-installation program can not be used properly
--test: It is not true to install, but to detect whether there is a software dependency problem installed correctly.
--replacepkgs: Table indicates reinstalling this program
--prefix Path
Indicates that you want to install the software under a path
--nosignature: Does not check the source legitimacy and signature of the package
--nodeigest: Package integrity is not checked
[Email protected] mnt]# RPM-IVH--nodeps--test--nosignature--nodigest zsh-5.0.2-14.el7.x86_64.rpm Preparing ... ################################# [100%]
RPM Upgrades and updates
RPM-UVH Package_file
If the package file is not installed, it will be installed directly; If a package_file old file exists, it will be upgraded
RPM-FVH Package_file ...
If the package file is not installed, it will not be installed directly; If a package_file old file exists, it will be upgraded.
Updates for RPM upgrades can also be used with--nodeps--nosignature
Note: (1) The kernel cannot be upgraded and a new version of the kernel needs to be installed directly
(2) If the original package configuration file is modified, the upgrade will not overwrite the configuration file, but the new version of the file to rename.
RPM Uninstall:
Rpm-e
Rpm-e--test
Rpm-e--nodeps
[Email protected] mnt]# RPM-EVH--nodeps--test zsh Preparing ... ############################## # # [100%]
RPM Query
RPM-QA check for packages that have already been installed
[Email protected] mnt]# Rpm-qa zshzsh-5.0.2-14.el7.x86_64
RPM-QF: Query which package is installed by the specified file
[Email protected] mnt]# Rpm-qf/etc/passwdsetup-2.8.71-6.el7.noarch
RPM-QP backage: View non-installed RPM package information
[Email protected] mnt]# rpm-qp bc-1.06.95-13.el7.x86_64.rpm warning:bc-1.06.95-13.el7.x86_64.rpm:header V3 RSA/ SHA256 Signature, Key ID f4a80eb5:nokeybc-1.06.95-13.el7.x86_64
Rpm-q--whatprovides < function;: query all packages that need < function > to work properly
[Email protected] mnt]# rpm-q--whatprovides/etc/passwdsetup-2.8.71-6.el7.noarch
Rpm-q--whatequires < functions > Query all < features > packages
[Email protected] mnt]# rpm-q--whatrequires/sbin/nologin openssh-6.6.1p1-22.el7.x86_64gdm-3.14.2-12.el7.x86_64
RPM-QL: Viewing files that are generated after a program is installed
[Email protected] mnt]# RPM-QL bc/usr/bin/bc/usr/bin/dc/usr/share/doc/bc-1.06.95/usr/share/doc/bc-1.06.95/authors /usr/share/doc/bc-1.06.95/copying ...
Rpm-qi: Querying for information about packages
[[email protected] mnt]# rpm -qi zshname : zshVersion : 5.0.2Release : 14.el7architecture: x86_64install date: sun 20 mar 2016 10:15:27 pm CSTGroup : System Environment/ShellsSize : 5834871license : mitsignature : RSA/SHA256, Thu 26 Nov 2015 12:07:38 AM CST, Key id 24c6a8a7f4a80eb5source rpm : zsh-5.0.2-14.el7.src.rpmbuild date : fri 20 nov 2015 09:11:36 pm cstbuild host : worker1.bsys.centos.orgRelocations : (not relocatable) packager : centos buildsystem RPM-QC: Viewing the program's configuration file
[Email protected] mnt]# RPM-QC ZSH/ETC/SKEL/.ZSHRC/ETC/ZLOGIN/ETC/ZLOGOUT/ETC/ZPROFILE/ETC/ZSHENV/ETC/ZSHRC
RPM-QD: Viewing a description of a program document
[Email protected] mnt]# RPM-QD zsh/usr/share/doc/zsh-5.0.2/bugs/usr/share/doc/zsh-5.0.2/contributors/usr/share/ Doc/zsh-5.0.2/faq/usr/share/doc/zsh-5.0.2/features/usr/share/doc/zsh-5.0.2/licence/usr/share/doc/zsh-5.0.2/ Machines/usr/share/doc/zsh-5.0.2/news/usr/share/doc/zsh-5.0.2/readme/usr/share/doc/zsh-5.0.2/ Completion-style-guide/usr/share/doc/zsh-5.0.2/zsh-development-guide
RPM--provides: What features are provided by the package
[Email protected] mnt]# rpm-q--provides zsh config (zsh) = 5.0.2-14.el7zsh = 5.0.2-14.el7zsh (x86-64) = 5.0.2-14.el7
Rpm-requires Viewing program dependencies
[Email protected] mnt]# rpm-q--requires zsh/bin/sh/bin/sh/bin/sh/bin/sh/bin/zsh/sbin/install-info
RPM Check
Rpm-v: Verifying files
[Email protected]]/mnt# VIM/ETC/ZSHRC [[email protected]]/mnt# rpm-v zsh s.5 ...] T. C/ETC/ZSHRC
RPM {--INITDB|--REBUILDDB} [--dbpath directory] [--root directory]
--INITDB: Initializes the database, currently no database can be initialized to create a new one;
[Email protected]]/tmp# rpm--initdb--dbpath=/tmp/db[[email protected]]/tmp# cd/tmp/db [email protected]]/tmp/ db# lsbasenames __db.002 Group obsoletename requirename triggernameconflictname __db.003 Installtid Packag Es sha1header__db.001 dirnames Name providename Sigmd5
--REBUILDDB: Rebuilt, re-created by reading all installed packages on the current system;
Package legitimacy and integrity verification:
First get the public key of the package author to local and then use the RPM--import public key Path
For centos7:rpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-7
RPM Management Tools