Install nginx and its required dependencies from configured repositories.
The package name is nginx.
Which command is appropriate?
apt install PACKAGE resolves the candidate version and dependencies, then installs the requested package.
Detailed explanation
apt search nginxIncorrect. apt search only finds candidates.
Incorrect. search finds candidates but does not install files.
apt install nginxCorrect. apt install nginx installs nginx and resolves its dependencies.
Correct. install resolves dependencies and installs nginx.
apt show nginxIncorrect. apt show displays package metadata.
Incorrect. show reads metadata without changing package state.
apt remove nginxIncorrect. apt remove deletes an installed package.
Incorrect. remove deletes an installed package.
Try it yourself
An example you can run in a temporary verification environment.
apt-get -s install nginxExpected result
実行計画が表示され、-sにより変更は行われないKey points
- install performs installation
- Dependencies are resolved
- -s can simulate
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
Search and show are read-only queries; install is the operation that expands the package into the system.
Check the side effect
Use apt's simulation option before an installation to review the proposed changes.