Which command searches a repository for files provided by a specific package?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command searches a repository for files provided by a specific package?

Explanation:
This tests how to map a specific file path to the package that provides it by checking repository metadata. The command yum provides /var/www/html asks the enabled repositories to find any package that includes that exact file in its payload. It returns the package name (and version) that would supply that file, which is exactly what you need when you want to install a package to obtain a particular file. Other options don’t fit as well: yum whatprovides /var/www/html is basically the same idea in many environments, but the standard form used to locate a file in repos is yum provides. rpm -qf /var/www/html looks up which installed package currently owns the file on your system, not which package would supply it from the repositories. yum search html scans package names or descriptions for the string “html,” not the actual file path.

This tests how to map a specific file path to the package that provides it by checking repository metadata. The command yum provides /var/www/html asks the enabled repositories to find any package that includes that exact file in its payload. It returns the package name (and version) that would supply that file, which is exactly what you need when you want to install a package to obtain a particular file.

Other options don’t fit as well: yum whatprovides /var/www/html is basically the same idea in many environments, but the standard form used to locate a file in repos is yum provides. rpm -qf /var/www/html looks up which installed package currently owns the file on your system, not which package would supply it from the repositories. yum search html scans package names or descriptions for the string “html,” not the actual file path.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy