30

I've develop debian packages and have syntax mistake in my post/pre script (postrm in my case). I install package successfully, but now i can't remove this package :

/var/lib/dpkg/info/blablabla.postrm: 11: Syntax error: ";;" unexpected
dpkg: error processing blablabla (--remove):
 subprocess installed post-removal script returned error exit status 2

How can ignore it and completely remove package?

Reddy
  • 943
  • 6
  • 12
  • 21

1 Answers1

49

Well, personally I have no idea about this either. If --force-all doesn't work, I would simply edit /var/lib/dpkg/info/blablabla.postrm to get it right. You're removing the package so won't be worried about the script which will be soon removed, will you?

palacsint
  • 28,416
  • 10
  • 82
  • 109
wangguoqin1001
  • 663
  • 7
  • 14
  • 3
    Thanks. Doesn't try your way, i resolve it with create package with same name and correct empty postrm script and install it. While installed dpkg try to remove my bad package and have error then he try to use postrm from my new package and have no errors. – Reddy Feb 20 '12 at 07:42
  • 1
    In my case it was `/var/lib/dpkg/info/blablabla.prerm` – Jeroen Vermeulen - MageHost Feb 11 '15 at 13:47
  • @JeroenVermeulenBVBA The procedure for uninstalling is, firstly run blablabla.prerm, then remove the files from the package, and finally run blablabla.postrm. The command can be contained in either script, depending on either it should be ran before removing the files, or after it. – wangguoqin1001 Feb 11 '15 at 14:19