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. clean removes cached archives, not an installed package's configuration.
apt remove nginxIncorrect. apt remove normally leaves package-managed configuration.
Incorrect. remove normally leaves tracked configuration behind.
apt autoremove nginxIncorrect. autoremove targets unneeded automatic dependencies rather than providing purge semantics.
Incorrect. autoremove handles orphaned automatic dependencies.
apt purge nginxCorrect. apt purge nginx removes the package and its managed configuration.
Correct. purge 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 / ヘルプ表示のみ
- 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
Only purge addresses the selected package's tracked configuration; clean and autoremove target different sets of data.
Check the side effect
Review the package list and configuration files before confirming a purge.