We know that for Windows, if the application is installed, there are any registry, what menu, what Control Panel, etc. can be found to install the application. But Linux doesn't have these concepts, so how do we query which RPMs are installed and where?
Rpm-q PackageName Query whether to install the PackageName package with the specified name Rpm-qa query all installed RPM packages can be followed by a wildcard Rpm-qi packagename Query for more detailed information RPM-QL PackageName Find out exactly where this RPM is installed, locate the list of files after installation RPM-QF FILEPATH queries the specified path of the file is installed by which rpm RPM-QC PackageName queries the configuration file for the specified package name Configfiles RPM-QD PackageName Document Description where Docfiles Rpm-q--scripts PackageName View pre-installation (pre), post-installation (post), uninstall, before uninstalling the script to be executed.
If a RPM package is not installed, then I would like to Query for more detailed information Rpm-qpi path_rpm Find out exactly where this RPM is installed and locate the list of files after installation RPM-QPL path_rpm Query the configuration file for the specified package name Configfiles rpm-qpc path_rpm Document description where Docfiles rpm-qpd path_rpm Review pre-installation (pre), post-installation (post), uninstall, before uninstalling the script to be executed. RPM-QP--scripts path_rpm As above, just add the-p option, followed by the RPM packet path.
Note that sometimes we need to use the RPM package name, and sometimes we need to provide the path to the RPM. If the RPM is already installed, it is actually recorded in the RPM database (/var/rpm/lib), so the query uses the RPM package name directly. If not installed, you obviously need to use the path of the RPM.
[[email protected] rpm]# rpm -qa a* Attr-2.4.32-1.1avahi-0.6.16-1.el5automake14-1.4p6-13autoconf-2.59-12automake-1.9.6-2.1[[email protected] rpm]# rpm -qi aprName : apr Relocations: (not relocatable) version : 1.2.7 vendor: red Hat, Inc.Release : 11 build date: wed 17 jan 2007 08:36:50 am pstinstall date: fri 27 jun 2014 09:40:03 am pdt Build Host: ls20-bc2-14.build.redhat.comGroup : System Environment/Libraries Source RPM: apr-1.2.7-11.src.rpmsize : 267135 license: apache software licensesignature : DSA/SHA1, Wed 17 Jan 2007 12:29:27 PM PST, Key ID 5326810137017186packager : red hat, inc.
|