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. apt search only finds candidates.
apt install nginxCorrect. apt install nginx installs nginx and resolves its dependencies.
Correct. apt install nginx installs nginx and resolves its dependencies.
apt show nginxIncorrect. apt show displays package metadata.
Incorrect. apt show displays package metadata.
apt remove nginxIncorrect. apt remove deletes an installed package.
Incorrect. apt 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 / ネットワーク通信を行わないシミュレーション
- 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.