Openhabian upgrade failed with dpgk error

Hi,
I wanted to update from my OH 2.1 #928 snapshot to the latest release 2.1. So got the update to openhabian switched the repo channel etc. and hit “upgrade system”. I had about 40 apt-get updates open so far… after starting the upgrade I got this error message:

Fetched 104 MB in 1min 43s (1,000 kB/s)
[master c65f025] saving uncommitted changes in /etc prior to apt run
 Author: pi <pi@openHABianPi>
 1 file changed, 2 insertions(+), 1 deletion(-)
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 25354 files and directories currently installed.)
Preparing to unpack .../debconf_1.5.56+deb8u1_all.deb ...
Segmentation fault
dpkg: warning: subprocess old pre-removal script returned error exit status 139
dpkg: trying script from the new package instead ...
Segmentation fault
dpkg: error processing archive /var/cache/apt/archives/debconf_1.5.56+deb8u1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 139
Segmentation fault
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 139
Errors were encountered while processing:
 /var/cache/apt/archives/debconf_1.5.56+deb8u1_all.deb
Updating FireMotD available updates count ...
E: Sub-process /usr/bin/dpkg returned an error code (1)
FAILED

There is enough space on the SD and I tried with apt-get clean, autoremove and whatever I found regarding this error in other communities but without success.

I can not do any update to the system files or openhab currently :frowning:

Did anyone experience a similar error with other packages maybe? What am I missing and how could I fix this?

Regards,
Bernd

Hello @bernd_d,
seems like there was a problem updating debconf. That’s one of many Linux packages and it’s unrelated to openHAB. You’d better search the Internet to find a solution. Good luck!!

Hi @ThomDietrich, you are right this is not directly related to openHAB but many users here are very experienced in Linux. The luck was not on my side so far but maybe on others here… :wink:

try
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get -f install

Also check /usr/bin/ for a file called dpkg. (make sure the executable is there)

Google says this:

"A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core . Segfaults are caused by a program trying to read or write an illegal memory location.Nov 30, 2016

@Travalon thanks for the hints, I tested it again in the sequence you mentioned but it hangs at apt-get autoremove with the same error as above…

Did you try the last command?

apt-get -f install

To be honest I’m more Linux-fool as opposed to Linux-fu. Its probably quicker to back up your config files and burn a new image.

A few of commands you can try in sequence, although I’d recommend making a backup anything important now.

sudo dpkg --configure -a
sudo dpkg -i --force-overwrite /var/cache/apt/archives/debconf_1.5.56+deb8u1_all.deb
sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade

@Benjy, thank you for this additional hint. --configure runs into another error and the -i --force-overwrite runs into a similar error as originally posted…

The error of --configure -a is:

dpkg: error processing package debconf (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 debconf

As I have already backed up my files, I think I need to go the new install route… :confounded:

I was facing the exact same issue, and new install was the only way to resolve.

@Chri46 Did you find out what the reason for this was? Corrupt deb package? Bad SD Card? Or just bad luck?

If sudo apt-get install --reinstall debconf doesn’t work I’m not really sure what to suggest I am afraid.

I was not able to determine which deb package was corrupt.
The only think I am certain about is that SD card was not causing the issue.
sudo apt-get remove of openhab and openhab-addons followed by fresh install of main release did the trick.