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. search finds candidates by name or description.
apt-cache policy nginxIncorrect. policy shows installed and candidate versions plus priorities.
Incorrect. policy reports versions and priorities.
apt-cache rdepends nginxIncorrect. rdepends lists packages depending on nginx, the reverse direction.
Incorrect. rdepends lists consumers of nginx, not nginx's required packages.
apt-cache depends nginxCorrect. apt-cache depends nginx displays nginx's dependency relationships.
Correct. depends lists the packages required by nginx.
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 / ローカルキャッシュ
- 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
depends and rdepends traverse the same relationship in opposite directions.
Check the side effect
Choose a package with known dependencies and compare both queries.