Home >Operation and Maintenance >CentOS >How to check where the rpm package is in centos
In centos, you can use the rpm command to check where the rpm package is; this command can obtain the relevant information of the rpm package. Setting the parameter "q" can represent the query, and setting the parameter "l" represents the list. Used to obtain the file list of rpm packages, the syntax is "rpm -ql rpm package name".
The operating environment of this article: centos 7 system, Dell G3 computer.
It is very convenient to use yum to install the rpm package in the CentOS system, but the directory where the software is installed is already fixed when the rpm package is produced. The installation directory cannot be changed.
If you want to view the rpm software package installation directory, you need to know the full name of the rpm software package first, and then use the rpm -ql [pakageName] command to output the installation directory.
To obtain information related to the software package, use rpm -q, q means query, and can be followed by other options, such as
i means info, to obtain the information of the software package;
l means list, get the file list;
a means all, execute the query in all packages;
f means file, perform related queries based on the file;
p Indicates package, query based on the software package
The required query conditions can be generated using grep, or generated from the command line in "` `"
The example is as follows:
Take installing nodejs as an example, and use rpm -qa|grep nodejs to find the full name of the rpm package.
Install nodejs software.
[root@centos ~]# yum install nodejs
Find the full name of the rpm package.
# nodejs 版本 [root@centos ~]# node -v v6.17.1 # rpm 包全名 [root@centos ~]# rpm -qa|grep nodejs nodejs-6.17.1-1.el7.x86_64
Recommended tutorial: "centos tutorial"
The above is the detailed content of How to check where the rpm package is in centos. For more information, please follow other related articles on the PHP Chinese website!