OH2 beta4 upgrade on debian failed, uninstall with errors

I did the openhab2-online update on ubuntu from beta3 to beta4, but had errors. Seems like a permission problem with the result, that my installation was a mess. Unfortunately, uninstalling failed with errors as well:

$ sudo dpkg --remove -D 777 openhab2-online
D000001: ensure_diversions: new, (re)loading
D000001: deferred_remove package openhab2-online:all
D000001: checking dependencies for remove 'openhab2-online:all'
(Reading database ... 196427 files and directories currently installed.)
D000200: oldconffsetflags '/etc/default/openhab2' namenode 0x1676d58 flags 4
D000200: oldconffsetflags '/etc/openhab2/html/index.html' namenode 0x16830f8 flags 4
D000200: oldconffsetflags '/etc/openhab2/html/readme.txt' namenode 0x1683130 flags 4
D000200: oldconffsetflags '/etc/openhab2/icons/classic/readme.txt' namenode 0x1683168 flags 4
D000200: oldconffsetflags '/etc/openhab2/items/readme.txt' namenode 0x16831a0 flags 4
D000200: oldconffsetflags '/etc/openhab2/persistence/readme.txt' namenode 0x16831d8 flags 4
D000200: oldconffsetflags '/etc/openhab2/rules/readme.txt' namenode 0x1683210 flags 4
D000200: oldconffsetflags '/etc/openhab2/scripts/readme.txt' namenode 0x1683248 flags 4
D000200: oldconffsetflags '/etc/openhab2/services/readme.txt' namenode 0x1683280 flags 4
D000200: oldconffsetflags '/etc/openhab2/services/runtime.cfg' namenode 0x16832b8 flags 4
D000200: oldconffsetflags '/etc/openhab2/sitemaps/readme.txt' namenode 0x16832f0 flags 4
D000200: oldconffsetflags '/etc/openhab2/things/readme.txt' namenode 0x1683328 flags 4
D000200: oldconffsetflags '/etc/openhab2/transform/de.map' namenode 0x1683360 flags 4
D000200: oldconffsetflags '/etc/openhab2/transform/en.map' namenode 0x1683398 flags 4
D000200: oldconffsetflags '/etc/openhab2/transform/readme.txt' namenode 0x16833d0 flags 4
D000200: oldconffsetflags '/var/lib/openhab2/etc/java.util.logging.properties' namenode 0x1683440 flags 4
D000200: oldconffsetflags '/var/lib/openhab2/etc/jetty.xml' namenode 0x1683478 flags 4
D000200: oldconffsetflags '/var/lib/openhab2/etc/keystore' namenode 0x16834b0 flags 4
D000200: oldconffsetflags '/var/lib/openhab2/deploy/README' namenode 0x1683520 flags 4
D000200: oldconffsetflags '/var/lib/openhab2/tmp/README' namenode 0x1683590 flags 4
D000200: oldconffsetflags '/etc/openhab2/services/addons.cfg' namenode 0x1683600 flags 4
Removing openhab2-online (2.0.0~b4) ...
D000002: fork/exec /var/lib/dpkg/info/openhab2-online.prerm ( remove )
 * Stopping openHAB2 server openhab2                                                                                                                                         stop: Ignoring predefined value for KARAF_HOME
Can't connect to the container. The container is not running.
                                                                                                                                                                      [fail]
invoke-rc.d: initscript openhab2, action "stop" failed.
dpkg: error processing package openhab2-online (--remove):
 subprocess installed pre-removal script returned error exit status 1
D000001: ensure_diversions: same, skipping
D000002: fork/exec /var/lib/dpkg/info/openhab2-online.postinst ( abort-remove )
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
 openhab2-online

This error on removal appears because of stopping the Karaf server exists with errors. I could fix it by removing the stop-server in /var/lib/dpkg/info/openhab2-online.prerm. So if anyone else has this error, this should do the trick.

Maybe the debian package maintainer could have a look on the removal-skript. :slight_smile:

Please enter issues for such things at https://github.com/openhab/openhab-distro/issues and ping @theo for help!

Done. :slight_smile:

Besides, the messed up installation seems to be caused by missing beta3 files on https://jcenter.bintray.com/org/openhab/distro/. I also filed an issue.