RPM is a very powerful package management system that makes it easy to install, upgrade, and remove software packages under Linux, as well as query and verify the functionality of software packages. The way to use commands is more flexible and more powerful than graphical tools.
The following describes the Example.1.2.3-1.i386 package as an example to introduce installation, upgrade, update with the query and other operations and installation use.
1. Installation, upgrades and updates
Install a new package.
Rpm-u upgrades an existing package in a system and installs it if it does not exist.
RPM-F updates a package that does not install if the package does not exist.
Often these items are also used in conjunction with other parameters, such as displaying information during installation and displaying the installation progress:
The-V option indicates that various information, such as the installation path and what is installed, is displayed during installation.
The-H option will display the installed progress bar at the RPM installation, which can monitor the system installation process.
Therefore, the most common form of command to install a package is to use the-UVH three parameters together, as an example of the installation package example described earlier, to enter the package installation command:
[Root@localhost root]# RPM-UVH example-1.2.3-1.i386.rpm where example-1.2.3-1.i386.rpm is the full name of the package, with 1.2.3-1 to represent the package version, i386 indicates that the package applies to the x86 system.
2, delete
The command to delete a package is:
[Root@localhost root]# Rpm-e Example
Note that this deletion uses the name of the software rather than the full name of the package.
3, inquiry
You can query not only the RPM packages that are already installed in your system, but also the list of files contained in an RPM package installation file.
1 to list the RPM packages that the user has installed
If you want to query the package information installed in the system, or if a package is installed, use PM-QA (query all) to query the list of installed packages;
If you are viewing a package that is already installed, such as example information, use Rpm-q example.
2 View the files included in a RMP package
To view a list of files contained in a package, there are two scenarios:
If the package example is not installed, use the
[Root@localhost root]# RPM-QLP example-1.2.3-1.i386.rpm
If the package is already installed, use the
[Root@localhost root]# RPM-PL Example
3 Determine which RPM package a file belongs to
If you encounter a file you don't know and want to find out which package it belongs to, first record the full path to the file, and then use the following command:
[root@localhost root]# rpm-qf filename-qf option indicates the query file, filename requires a complete file path.
4) Query the use of RPM package
Some RPM packages use additional information to contain information about its purpose, so that users can more easily inquire about the purpose, version, etc. of each package when installing or using it, as follows:
[Root@localhost root]# RPM-QIP example-1.2.3-1.i386.rpm