Install / uninstall / reinstall

mborchorst wrote on Monday, December 17, 2012:

Dear gurus
I have run into some problems as I am reinstalling my server after an upgrade.

I installed 4.1.0 and patched upto what my server runs, installed the backup… hoeray. everything is fine. To rehearse an upgrade to 4.1.1 I succesfully did the upgrade. But when I tried to downgrade to  be able to install the live data, things went wrong, and I have been trying all the tricks I can and quite a few i definitely can not, including installing the deb. package and deinstalling it.
Now the situation is that I have managed to install openemr manually, and it seemingly works. But all my attempts to solve the problem via deb. package management has renderd apt in a sorryful state. When I do an “apt-get dist-upgrade” I get this:

Indlæser pakkelisterne...
Opbygger afhængighedstræ...
Læser tilstandsoplysninger...
Følgende pakker vil blive AFINSTALLERET:
  openemr
Følgende pakker vil blive opgraderet:
  apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2.2-bin
  apache2.2-common bind9-host dnsutils exim4 exim4-base exim4-config
  exim4-daemon-light host libbind9-60 libdns69 libisc62 libisccc60 libisccfg62
  liblwres60 libmysqlclient16 libperl5.10 libtiff-tools libtiff4 libxml2
  mysql-client-5.1 mysql-common mysql-server mysql-server-5.1
  mysql-server-core-5.1 perl perl-base perl-modules tzdata tzdata-java
34 opgraderes, 0 nyinstalleres, 1 afinstalleres og 0 opgraderes ikke.
1 ikke fuldstændigt installerede eller afinstallerede.
0 B/41,7 MB skal hentes fra arkiverne.
Efter denne handling, vil 111 MB diskplads blive frigjort.
Vil du fortsætte [J/n]? Prækonfigurerer pakker ...
(Læser database ... 37712 filer og kataloger installeret i øjeblikket.)
Afinstallerer openemr...
dpkg (underproces): kunne ikke køre installerede post-removal-script (/var/lib/dpkg/info/openemr.postrm): Ugyldigt format på eksekverbar fil
dpkg: fejl under behandling af openemr (--remove):
 underproces installerede post-removal-script returnerede afslutningsstatus 2
Der opstod fejl under behandlingen:
 openemr

So I can not do the needed security procedures.
Any body has an idea how to deinstall the openemr deb.package under those circumstances?

BTW.  Running Debian.stable on the server.

Thks

Morten

mborchorst wrote on Monday, January 14, 2013:

Kind of solved. Deleting /var/lib/dpkg/info/openemr.postrm made apt-get work again.
What happes when I need to update… Wil show later.