Services and User Management

An administrator removed nginx from an Ubuntu server with apt remove. The files in /etc/nginx are still present, and the administrator wants to reinstall nginx later with no leftover configuration. Which command deletes those remaining configuration files?

Show the answer

Correct answerA. sudo apt purge nginx

apt purge removes a package's configuration files, including those left behind after a plain remove. apt autoremove is tempting, but it only removes dependencies that are no longer needed and does not delete a removed package's configuration. apt clean only empties the downloaded package cache.