Remove installed nginx.
Also remove configuration files managed by the package.
Which command is appropriate?
apt purge removes the package and its package-managed configuration files; it does not automatically erase all user data.
Detailed explanation
apt clean nginxIncorrect. apt clean manages downloaded package caches, not a package's configuration.
Incorrect. apt clean manages downloaded package caches, not a package's configuration.
apt remove nginxIncorrect. apt remove normally leaves package-managed configuration.
Incorrect. apt remove normally leaves package-managed configuration.
apt autoremove nginxIncorrect. autoremove targets unneeded automatic dependencies rather than providing purge semantics.
Incorrect. autoremove targets unneeded automatic dependencies rather than providing purge semantics.
apt purge nginxCorrect. apt purge nginx removes the package and its managed configuration.
Correct. apt purge nginx removes the package and its managed configuration.
Try it yourself
An example you can run in a temporary verification environment.
apt-get --help | grep -E 'purge'Expected result
purge - パッケージと設定ファイルの削除に相当する説明Key points
- purge removes configuration
- remove has a narrower scope
- User data is separate
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.