Home  >  Article  >  Operation and Maintenance  >  What are the methods to find the location of RPM packages in Linux?

What are the methods to find the location of RPM packages in Linux?

PHPz
PHPzOriginal
2024-03-15 08:48:031229browse

What are the methods to find the location of RPM packages in Linux?

There are many ways to find the location of the RPM package in Linux, which can be found through the command line. The following are several commonly used methods, with specific code examples:

  1. Use the rpm command to find the installed package path:

    rpm -ql [包名]

    This command can list Specifies the file path for the package installation where the RPM package files can be found.

  2. Use the yum command to find the installed package path:

    yum list installed | grep [包名]

    This command can list all installed packages, filter out the specified package through the grep command, and find it The location of the RPM package file.

  3. Use the find command to find the RPM package in the file system:

    find / -name [包名].rpm

    This command will search the entire file system for the RPM package file with the specified name, which may take a while. can be found.

  4. Find the RPM package cache directory:

    ls /var/cache/yum/[系统发行版]/packages/[包名]-[版本号]-[发行版].arch.rpm

    This command can search for the specified RPM package file in the yum cache directory.

Through the above methods, you can effectively find the storage location of the RPM package in the Linux system. When searching, you need to pay attention to entering the correct package name in order to find the accurate file path.

The above is the detailed content of What are the methods to find the location of RPM packages in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn