LX0-103 · Question #11
When removing a package, which of the following dpkg options will completely remove the files including configuration files?
The correct answer is C. --purge. The dpkg --purge option completely removes a package including its configuration files, whereas a standard removal leaves config files behind.
Question
When removing a package, which of the following dpkg options will completely remove the files including configuration files?
Options
- A--clean
- B--delete
- C--purge
- Dremove
How the community answered
(33 responses)- A3% (1)
- C94% (31)
- D3% (1)
Why each option
The dpkg --purge option completely removes a package including its configuration files, whereas a standard removal leaves config files behind.
--clean is not a valid dpkg removal option; it is used in apt contexts to clear the package cache, not to remove packages.
--delete is not a recognized dpkg option for package removal.
The --purge option instructs dpkg to remove all files associated with a package, including configuration files that would normally be retained by a standard removal. This brings the package to a 'not-installed, no-config' state, which is useful when a clean reinstall or full decommission is required.
The 'remove' option (or -r) removes the package binaries but intentionally preserves configuration files in case the user reinstalls the package later.
Concept tested: dpkg complete package removal including config files
Source: https://man7.org/linux/man-pages/man1/dpkg.1.html
Topics
Community Discussion
No community discussion yet for this question.