List the paths contained in nginx, even if it is not installed.
Start from the package name rather than reverse-looking up a path.
Which command is appropriate?
apt-file list PACKAGE lists paths supplied by a package from Contents indexes. apt-file search works in the opposite direction.
Detailed explanation
apt-file search nginxIncorrect. search looks for matching paths and does not limit results to nginx's complete file list.
Incorrect. search looks for packages by a path pattern.
apt-cache show nginxIncorrect. apt-cache show displays metadata, not the file list.
Incorrect. apt-cache show does not enumerate archive paths.
apt-file list nginxCorrect. apt-file list nginx lists paths supplied by nginx.
Correct. list enumerates the paths provided by nginx.
apt-cache policy nginxIncorrect. policy displays version and source priority information.
Incorrect. policy reports candidate versions and priorities.
Try it yourself
An example you can run in a temporary verification environment.
apt-file list nginx | sed -n '1,5p'Expected result
nginx: で始まる収録ファイルパス。apt-fileとContents索引が必要Key points
- list maps package to files
- search maps path to package
- Uninstalled packages can be queried
Notes
- Environment: apt-file 3.x / 索引更新済み環境
- Use a disposable environment or simulation before package changes.
- APT behavior can vary with repository configuration and package-manager version.
Foundation review
Place the operation
The package-to-path query is different from both metadata display and path-to-package search.
Check the side effect
Run list for a package that is not installed and inspect the returned archive paths.