It is becoming increasingly popular to use RPM packages to release software. The main reason is that this software release method is convenient for users to install, upgrade, and delete from the system. In addition, RPM allows you to manage more software installed in the system. For example, you can check which software packages have been installed in the system, check what files are installed in these software packages, where these files are stored, and so on.
Here I will provide a simple getting started manual for beginners to view and quickly use RPM. These RPM commands are the most commonly used. For more complex functions, you do not need to worry about them for the time being. You can check man's manual when necessary. Let's start.
◆ The command format used to install an RPM package is as follows:
# Rpm-ivh package. ix86.rpm
In the preceding command, the package is a hypothetical name. ix86 indicates that the package is optimized for a specific CPU. For example, package may be a ldconfig-1.9.5-14, while ix86 is i386.
"-I"The parameter indicates that the package is to be installed, and"-V"This parameter increases the output information,"-H"It indicates that hashes is displayed as a progress bar during the installation process.
The above is all about installing an RPM package, which is very simple and easy to use. Of course, if you encounter some package dependency problems during the installation process, it will be a little troublesome. The package dependency problem is that the package you are installing requires the support of other packages to work normally. A common problem is that the installed package requires a specific version of a software or function library to work properly. In this case, you can install or upgrade the dependent software package, and then continue to install the software package you need to install.
Next we will look at some other very useful rpm commands.
◆ Query RPM package content:
If you want to see which files are installed after an RPM package is installed, you can use this command:
# Rpm-ql packagename
This packagename is the name of the package you want to query, such as the ldconfig-1.9.5-14mdk; and"-P"The parameter indicates querying the software package database to check whether the software package has been installed;"-L"The parameter indicates the complete path of all installed files of the queried package.
The following is an example:
[wh@infonet wh]$ rpm -ql ldconfig-1.9.5-14mdk /sbin/ldconfig /usr/doc/ldconfig-1.9.5 /usr/doc/ldconfig-1.9.5/README |
◆ Delete a specific RPM package
In addition to querying the information of a software package, you can also conveniently delete a specific RPM software package. The command parameter used is"-E"The format is as follows:
# Rpm-e packagename
"-E" means to delete the specified packagename.
It is worth noting that the rpm management mechanism does not allow you to delete a software package if it is also dependent on other software packages. Once you delete this software package, other software packages dependent on it will not work properly.
◆ Upgrade an existing rpm package
I have learned how to install and delete an rpm package. Let's see how to upgrade an existing rpm package. The upgrade is similar to the installation. You can refer to the following command:
# Rpm-Uvh package. ix86.rpm
"-U" parameter indicates upgrading upgrade). The values of "v" and "h" are the same as those described above.
At this point, we have learned how to install, delete, and upgrade a software released using rpm.
Related Articles]