14.3 "Linux Learning Is Not Difficult" Using RPM Packages ( 3 ): Install RPM Packages
The installation process of the RPM package is shown in Figure 9.1 . If the package meets the dependencies, the installation is allowed. If the dependencies are not satisfied, other software packages need to be installed first.
Use the rpm command to install, delete, refresh, upgrade, and query RPM packages in a Linux system .
Command syntax:
rpm [ options ] [RPM package file name ]
The meaning of each option in the command is shown in the table.
Options |
Meaning of options |
-i |
Install the package |
-v |
output details |
-h |
Print hash marks when installing packages |
--replacepkge |
Reinstall the software whether or not the package is already installed |
--test |
Only the installation is tested, not the actual installation |
--nodeps |
Do not verify package dependencies |
--force |
Ignore package and file conflicts |
--percent |
Output the progress of the installation as a percentage |
--ignorearch |
Do not verify the schema of the package |
--ignoresize |
Do not check disk space before installation |
--replacefiles |
Ignore file conflicts between packages |
-e |
remove package |
-U |
upgrade package |
-F |
refresh package |
--oldpackage |
Upgrading packages from older versions |
-q |
query package |
--initdb |
Initialize the RPM database |
--rebuilddb |
Rebuild the RPM database from the install headers |
Example: Install the bind-9.9.4-29.el7.x86_64.rpm package and display detailed information and a horizontal progress bar during the installation.
[root@rhel Packages]# rpm -ivh bind-9.9.4-29.el7.x86_64.rpm
Example: Install packages starting with bind .
[root@rhel Packages]#rpm -ivh bind*
Example: Install the package even if the package bind-9.9.4-29.el7.x86_64.rpm is already installed.
[root@rhel Packages]# rpm -ivh --replacepkgs bind-9.9.4-29.el7.x86_64.rpm
Example: Ignore the dependencies of the package and force the bind-chroot-9.9.4-29.el7.x86_64.rpm package to be installed.
[root@rhel Packages]# rpm -ivh --nodeps bind-chroot-9.9.4-29.el7.x86_64.rpm
This article is excerpted from " Learning Linux is not difficult"Teaching material, this is a most practical Linux introductory teaching material with equal emphasis on theory and practice. To read the entire book, please visit Linux Operators ( www.linuxywz.com) website .