乐闻世界logo
搜索文章和话题

How to list the contents of a package using YUM?

1个答案

1

To list the contents of a package using YUM (Yellowdog Updater, Modified), you must first ensure that yum-utils is installed. yum-utils is a collection of utilities that extend YUM's functionality, including repoquery. repoquery is a powerful tool for querying package information in the repository.

Installing yum-utils

If you have not installed yum-utils, you can install it using the following command:

bash
sudo yum install yum-utils

Using repoquery to List Package Contents

After installing yum-utils, you can use the repoquery command to list the contents of a package. For example, to view the contents of the httpd package, use the following command:

bash
repoquery -l httpd

This command lists all files and directories within the httpd package.

Example

For instance, to view the contents of the nginx server package, run:

bash
repoquery -l nginx

This will output all file paths contained in the nginx package, allowing you to quickly see which files the package installs on the system.

Summary

Using repoquery -l is a straightforward method to view package contents, which is highly useful for understanding the installation details of a package. This can help you make better decisions when manually modifying files or understanding how various components interact.

2024年8月16日 23:21 回复

你的答案