always purge on remove in package

Posted by Jeroen on Ask Ubuntu See other posts from Ask Ubuntu or by Jeroen
Published on 2012-10-18T04:29:51Z Indexed on 2012/10/18 5:22 UTC
Read the original article Hit count: 378

Is there a way I can set my package to always automatically include a --purge whenever a user does a regular apt-get remove mypackage ?

The reason is that I have some config files in /etc that should really be removed when the binaries are removed, otherwise it can lead to weird behavior. However I still want to treat them as conf files, i.e. make sure apt does not just wipe them on every upgrade of the package. But they should be removed when the package is uninstalled.

Currently I am manually deleting the /etc conf files in my postrm script. However I just found out that this has a unfortunate side effect: if the user uninstalls and then later re-installs the package, the conf files won't be reinstalled, because apt thinks that they are still there. So is there a way I can manually trigger a full 'purge' in my postrm, such that apt knows that the conf files are gone?

© Ask Ubuntu or respective owner

Related posts about apt

Related posts about package-management