Shared library "bz.so.1" missing

Hey there,

I run Nextcloud
on a Raspberry Pi 2
with up to date Raspbian Jessie
on Linux kernel 4.9.27-v7+,
Apache/2.4.25
mod_php 7.0.19-1
MariaDB 10.0.30.

I lately often get the following error that prevents several services and other things to start: php-gd (and therefore nextcloud) and every x server application:

error while loading shared libraries: l(bz.so.1: cannot open shared object file: No such file or directory

I do not find anything about “bz.so.1”, there is libbz2.so.* libz.so.* and others, but no bz.so.*. I am thinking if this is actually a typo where “l(bz.so.1” actually means “libz.so.1”? But this is there in /lib/arm-linux-gnueabihf/. I also tried reinstalling all the affected packages, zlib1g, php-gd etc. etc. with no success.

Does anybody have an idea what the problem is?

Thanks and best regards!

€: As libz was not present in /usr/lib/… I tried to fix it by creating a symlink to /lib/… . Now the error looks different:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/gd.so' - l(bz.so.1#002libpng12.so.0: cannot open shared object file: No such file or directory in Unknown on line 0

This looks crazy to me. libpng12.so.0 shows up in /lib/arm-linux-gnueabihf/ and /usr/lib/arm-linux-gnueabihf/:

root@micha:/# find -name libpng12.so.0
./lib/arm-linux-gnueabihf/libpng12.so.0
./usr/lib/arm-linux-gnueabihf/libpng12.so.0

Same error if I try to start synaptic (x11 server) or another gui program with x11:

leafpad: error while loading shared libraries: l(bz.so.1libpng12.so.0: cannot open shared object file: No such file or directory

There high likely was something broken deeper inside the system, maybe due to some unlucky server crash. I faced several additional problems here and there and finally resolved everything by upgrading my raspbian distribution to stretch/testing (nothing to loose :smile:).

I can’t recommend that to anybody with working system, took me a whole day to perform the upgrade and resolve several issues in between. Finally it feels like nearly the whole system was purged and reinstalled. Additionally all gui parts were removed.