List packages that nginx depends on, recommends, or conflicts with.
Do not install anything.
Which command is appropriate?
apt-cache depends shows outward relationships from a package. rdepends instead shows packages that depend on it.
Detailed explanation
apt-cache search nginxIncorrect. apt-cache search matches package names and descriptions.
Incorrect. apt-cache search matches package names and descriptions.
apt-cache policy nginxIncorrect. policy shows installed and candidate versions plus priorities.
Incorrect. policy shows installed and candidate versions plus priorities.
apt-cache rdepends nginxIncorrect. rdepends lists packages depending on nginx, the reverse direction.
Incorrect. rdepends lists packages depending on nginx, the reverse direction.
apt-cache depends nginxCorrect. apt-cache depends nginx displays nginx's dependency relationships.
Correct. apt-cache depends nginx displays nginx's dependency relationships.
Try it yourself
An example you can run in a temporary verification environment.
apt-cache depends apt | sed -n '1,8p'Expected result
Depends、PreDepends、Recommendsなどの関係とパッケージ名Key points
- depends shows dependencies
- rdepends shows reverse dependencies
- policy shows versions
Notes
- Environment: APT 2.x / ローカルキャッシュ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.