Re: Running dpkg -r foo from a postinst script?
On Wed, 19 Sep 2001, Colin Watson wrote:
> On Wed, Sep 19, 2001 at 06:11:53PM +0200, Ola Lundqvist wrote:
> > I have a simple question. Is it possible to run dpkg -r foo
> > from within a postinst-script when using dselect or apt?
> > What is the result?
> You can't do it directly, as dpkg has locked the status file at that
> point. The sgmltools-lite (?) maintainer tried hacking around that by
> waiting for the lock to be released once, and it immediately got a
> justifiable grave bug; the race conditions are ugly. Don't do it.
So, then we dpkg developers should add this ability.
Some of the code already exists to do this, it'll be a variation of