The dpkg command is a tool to install, build, remove and manage Debian packages. The option --remove is used to remove an installed package, but it does not remove the configuration files that may have been modified by the user. The option --purge is used to remove an installed package and also delete its configuration files. This can be useful if the user wants to completely uninstall a package and start from scratch if it is reinstalled later. The syntax is: dpkg --remove package or dpkg --purge package. For example, dpkg --remove nginx will remove the nginx web server package, but it will leave the configuration files in /etc/nginxdpkg --purge nginx will remove the nginx package and also delete the configuration files in /etc/nginx1. The other options are not correct because:
–remove only removes the program, --purge only removes the config files: This is false, because --purge also removes the program, not just the config files.
–remove removes a package, --purge also removes all packages dependent on it: This is false, because --purge does not remove any other packages, only the specified one. To remove a package and its dependencies, the apt-get command can be used with the option --auto-remove2.
–remove removes only the package file itself, --purge removes all files related to the package: This is false, because --remove also removes the files that are installed by the package, not just the package file itself. --purge only removes the configuration files that are not removed by --remove. References:
dpkg(1) — dpkg — Debian buster — Debian Manpages
How to remove a package and its dependencies with dpkg? - Ask Ubuntu
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit