Skip to content

apt.Delete() ignores --purge (ArgsPurge) #1

@brunodam

Description

@brunodam

Description

When using the Go library and calling the Delete() function in the apt backend with ArgsPurge set in CustomCommandArgs, the purge behavior is not applied. The package is removed, but config files remain (dpkg shows state rc).

Example (Go snippet):

opts := &manager.Options{
    AssumeYes:         true,
    CustomCommandArgs: []string{manager.ArgsPurge}, // request purge
}
aptPM.Delete([]string{"ebtables"}, opts)

###Expected
The command executed should be equivalent to:

apt remove --purge ebtables

so that configuration files are also removed.

Actual

The package is removed, but config files remain:

dpkg-query -W -f='${Status}\n' ebtables
# => deinstall ok config-files

Notes

  • This issue is about supporting purge when explicitly requested.
  • Default behavior (apt remove) should remain unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions