Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rm_conffile and conffile directory

63 views
Skip to first unread message

Tong Sun

unread,
Feb 22, 2021, 12:40:03 AM2/22/21
to
Hi,

Can I use rm_conffile to remove a (conffile) directory?

I checked the man page but am still not too sure about that.

thx

Tong Sun

unread,
Feb 22, 2021, 8:30:02 AM2/22/21
to
On Mon, Feb 22, 2021 at 12:33 AM Tong Sun wrote:

> Can I use rm_conffile to remove a (conffile) directory?
>
> I checked the man page but am still not too sure about that.

Moreover, in

The right way to remove an obsolete conffile in a Debian package
https://raphaelhertzog.com/2010/10/07/the-right-way-to-remove-an-obsolete-conffile-in-a-debian-package/

it says to put rm_conffile in the 3 relevant scripts (preinst, postinst, postrm)

However, when I did some research, I found that most packages put
rm_conffile in the .maintscript file. Where does that come from? It
is even not in the man page. OK that I put rm_conffile in the
.maintscript file as well, instead of in all 3 scripts (preinst,
postinst, postrm)?

Sebastiaan Couwenberg

unread,
Feb 22, 2021, 8:50:03 AM2/22/21
to
On 2/22/21 2:23 PM, Tong Sun wrote:
> However, when I did some research, I found that most packages put
> rm_conffile in the .maintscript file. Where does that come from? It
> is even not in the man page. OK that I put rm_conffile in the
> .maintscript file as well, instead of in all 3 scripts (preinst,
> postinst, postrm)?

dpkg-maintscript-helper(1) refers to dh_installdeb(1) which documents
the .maintscript files, see:

https://manpages.debian.org/buster/dpkg/dpkg-maintscript-helper.1.en.html
https://manpages.debian.org/buster/debhelper/dh_installdeb.1.en.html

--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1

Tong Sun

unread,
Feb 22, 2021, 9:10:02 AM2/22/21
to
On Mon, Feb 22, 2021 at 8:45 AM Sebastiaan Couwenberg -
seba...@xs4all.nl
<pkgoyq.xpt.4528cc8bd3.sebastic#xs4a...@ob.0sg.net> wrote:
>
> On 2/22/21 2:23 PM, Tong Sun wrote:
> > However, when I did some research, I found that most packages put
> > rm_conffile in the .maintscript file. Where does that come from? It
> > is even not in the man page. OK that I put rm_conffile in the
> > .maintscript file as well, instead of in all 3 scripts (preinst,
> > postinst, postrm)?
>
> dpkg-maintscript-helper(1) refers to dh_installdeb(1) which documents
> the .maintscript files, see:
>
> https://manpages.debian.org/buster/dpkg/dpkg-maintscript-helper.1.en.html
> https://manpages.debian.org/buster/debhelper/dh_installdeb.1.en.html

Got it. Thanks

A follow up question, dpkg-maintscript-helper(1) suggests to use

Pre-Depends: dpkg (>= 1.17.14)

But of the several packages that use rm_conffile that I checked, none
of them is using `Pre-Depends: dpkg (>= 1.17.14)` in their control
file. Was I not looking at the correct place or there is something
else (e.g., it's pretty safe not to do that nowadays)?

Tong Sun

unread,
Feb 22, 2021, 9:20:02 AM2/22/21
to
> On Mon, Feb 22, 2021 at 12:33 AM Tong Sun wrote:
>
> > Can I use rm_conffile to remove a (conffile) directory?
> >
> > I checked the man page but am still not too sure about that.

I am still not too sure about the above yet.

Sebastiaan Couwenberg

unread,
Feb 22, 2021, 9:30:03 AM2/22/21
to
On 2/22/21 3:08 PM, Tong Sun wrote:
> A follow up question, dpkg-maintscript-helper(1) suggests to use
>
> Pre-Depends: dpkg (>= 1.17.14)
>
> But of the several packages that use rm_conffile that I checked, none
> of them is using `Pre-Depends: dpkg (>= 1.17.14)` in their control
> file. Was I not looking at the correct place or there is something
> else (e.g., it's pretty safe not to do that nowadays)?

dpkg 1.17.27 is in oldoldstable, so the version requirement is met with
any reasonably recent Debian release:

$ rmadison -a amd64 dpkg
dpkg | 1.17.27 | oldoldstable | amd64
dpkg | 1.18.25 | oldstable | amd64
dpkg | 1.19.7 | stable | amd64
dpkg | 1.20.7.1 | testing | amd64
dpkg | 1.20.7.1 | unstable | amd64

Kind Regards,

Bas

Sven Joachim

unread,
Feb 22, 2021, 11:10:03 AM2/22/21
to
If you want to remove the directory, you need to do it yourself.
Something like

rmdir --ignore-fail-on-non-empty /etc/whatever

after the #DEBHELPER# line in the postinst script should do it, I think.
Unfortunately, dpkg-maintscript-helper is not very helpful here, see
https://bugs.debian.org/584185.

Cheers,
Sven
0 new messages