package postgis can't be purged if postgresql is not installed due to missing directory

Bug #392143 reported by Santosh
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postgis (Debian)
Fix Released
Unknown
postgis (Ubuntu)
Fix Released
Low
Jean-Baptiste Lallement
Karmic
Fix Released
Undecided
Jean-Baptiste Lallement

Bug Description

:: DESCRIPTION ::
postgis can't be removed if postgresql is not installed due to missing "/usr/lib/postgresql/8.3/lib" directory

:: VERSION ::
   postgis | 1.3.3-3 | intrepid/universe | source, amd64, i386
   postgis | 1.3.3-3 | jaunty/universe | source, amd64, i386
   postgis | 1.3.5-1 | karmic/universe | source, amd64, i386
   postgis | 1.3.6-2 | lucid/universe | source, amd64, i386

:: TEST CASE ::
$ sudo apt-get install postgis
$ sudo apt-get remove --purge postgis

Removing postgis ...

Purging configuration files for postgis ...

find: `/usr/lib/postgresql/8.3/lib': No such file or directory

dpkg: error processing postgis (--purge):

 subprocess post-removal script returned error exit status 1

:: WORKAROUND ::
$ sudo rm /var/lib/dpkg/info/postgis.postrm
$ sudo apt-get remove --purge postgis

=======
ProblemType: Package
Architecture: i386
Dependencies:

DistroRelease: Ubuntu 8.10
ErrorMessage: subprocess post-removal script returned error exit status 1
NonfreeKernelModules: nvidia
Package: postgis None
SourcePackage: postgis
Title: package postgis None failed to install/upgrade: subprocess post-removal script returned error exit status 1
Uname: Linux 2.6.27-14-generic i686

Revision history for this message
Santosh (santosh-osgeo) wrote :
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

security vulnerability: yes → no
visibility: private → public
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote : Re: package postgis None failed to install/upgrade: subprocess post-removal script returned error exit status 1

Confirmed in lucid.

~# apt-cache policy postgis
postgis:
  Installed: (none)
  Candidate: 1.3.6-2
  Version table:
     1.3.6-2 0

Changed in postgis (Ubuntu):
status: New → Confirmed
summary: - package postgis None failed to install/upgrade: subprocess post-removal
- script returned error exit status 1
+ package postgis can't be removed is postgresql is not installed due to
+ missing directory
description: updated
summary: - package postgis can't be removed is postgresql is not installed due to
+ package postgis can't be purged if postgresql is not installed due to
missing directory
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Patch proposal for lucid

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU for Karmic

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Hi,

and thanks for you work!

Wouldn't be easier to just rename postgis.postrm to postgresql-8.3-postgis.postrm as the link to be removed is installed by postgresql-8.3-postgis.postinst ? It seems that postgis.postrm is just here to remove the link, so it would do the trick.

I'm putting this bug report as Incomplete in the meantime. Please put back as Confirmed when answering to my question.

Thanks,

Fabrice

Changed in postgis (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Changed in postgis (Debian):
status: Unknown → Fix Released
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Hi Fabrice,

I try to stay as close as possible of the main maintainer's work when submitting an SRU, but your suggestion is the real fix indeed.
I've suggested it to the Debian maintainer and I'm waiting for his reply.

JB

Changed in postgis (Ubuntu):
assignee: nobody → Jean-Baptiste Lallement (jibel)
status: Incomplete → In Progress
Revision history for this message
Daniel Holbach (dholbach) wrote :

It might be worth syncing 1.4.0-2 from Debian, it seems to be fixed there: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560409

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Fabrice, here is the answer from Debian maintainer regarding the removal of the link in postgis.postrm

"[...] That link is there to allow an upgrade path from one postgis
version to another (with the same postgresql version), the purge should be done only
if one is interested in cleaning all postgis versions to do not use postgis anymore,
it should not be removed when a specific postgis edition is purged (which could happen
if admin would be too hasty in doing its homework). I think this way of doing the
thing is a bit more safe, indeed."

However, now that it's fixed upstream we can sync from Debian (note that latest postgis doesn't build on armel and mips) and I backported the fix to Karmic.

Changed in postgis (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU : Updated patch for karmic

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Backport from upstream to lucid.

Revision history for this message
Martin Pitt (pitti) wrote :

I synced sid into lucid, since sid's version also drops support for the obsolete 8.3.

I sponsored the karmic-proposed update.

Changed in postgis (Ubuntu):
status: Confirmed → Fix Released
Changed in postgis (Ubuntu Karmic):
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted postgis into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in postgis (Ubuntu Karmic):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

The package failed to build:

The following packages have unmet dependencies:
  jikes-classpath: Depends: jikes but it is not installable

so this cannot currently be tested.

Changed in postgis (Ubuntu Karmic):
assignee: nobody → Jean-Baptiste Lallement (jibel)
status: Fix Committed → In Progress
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

jikes has been deleted from the archive since karmic.
Replace build-depends from jikes-classpath to default-jdk in debian/control file and from jikes-classpath to javac in debian/rules.
The package builds fine on a clean i386 chroot. ?field.comment=jikes has been deleted from the archive since karmic.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Finally, patch against -proposed version as recommended on irc.

Thanks.

Changed in postgis (Ubuntu Karmic):
status: In Progress → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

FTBFS fix accepted, thanks!

So this is ready for testing in about two hours.

Changed in postgis (Ubuntu Karmic):
status: Confirmed → Fix Committed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Verification done in karmic. Test log attached.
A minor cosmetic effects still remains.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postgis - 1.3.5-1ubuntu2

---------------
postgis (1.3.5-1ubuntu2) karmic-proposed; urgency=low

  * Fixed libpostgis-java package FTBFS.

postgis (1.3.5-1ubuntu1) karmic-proposed; urgency=low

  * debian/postgis-generic.postrm.in : backport fix from 1.4.0-2 to not stop
    on error in postrm if the target dir does not exist. (LP: #392143)
 -- Jean-Baptiste Lallement <email address hidden> Wed, 23 Dec 2009 01:01:23 +0100

Changed in postgis (Ubuntu Karmic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.