'/lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found
I'm new to linux and using Eclipse Oxygen.2 Release 4.7.2 on Ubuntu 16.04
I'm getting the error:
/usr/lib/opencv-2.4.13.5/build/lib/libopencv_java2413.so: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/mel3/anaconda/lib/libpng16.so.16)
I've tried upgrading and reloading and not sure if there is a path error or what going on. Help much appreciated
Solution 1:[1]
The accepted answer didn't work for me, but following here did:
https://ubuntuforums.org/showthread.php?t=2375927
Repeating the answer:
cd /your_software/../lib/ (the directory containing libz.so.1)
mv libz.so.1 libz.so.1.old
ln -s /lib/x86_64-linux-gnu/libz.so.1
Solution 2:[2]
The accepted answer did not work for me either, and I really suggest being careful when symlinking over a widely used binary like /lib/x86_64-linux-gnu/libz.so.1.
The make uninstall for zlib-1.2.9 will destroy this symlink, which will break a ton of packages and be a huge pain to fix.
Alex's solution worked for me and is much less destructive, since you're only modifying the symlink in the directory of your executable, not the whole system.
Solution 3:[3]
if the solution of Kamrul hassan broke your pc don't panic and do :
sudo ldconfig
to restore to the previous state.
Solution 4:[4]
A safe option instead of messing up the system libraries is to download (or build) libz.so.1.2.9 and place it in the directory of your executable (or wherever) and export LD_LIBRARY_PATH to that directory
e.g.
cd /<DIRECTORY OF YOUR EXECUTABLE NEEDING ZLIB__1.2.9>/
export LD_LIBRARY_PATH=$PWD
Now your executable will load the zlib from new location instead of /lib/x86_64-linux-gnu
check with
ldd <executable>
zlib should be referenced from new LD_LIBRARY_PATH
Solution 5:[5]
Worked for me:
wget https://github.com/madler/zlib/archive/v1.2.11.tar.gz
tar -zxvf v1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/bin/zlib/
make
make install
export LD_LIBRARY_PATH="/bin/zlib/lib":$LD_LIBRARY_PATH
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alex Kaszynski |
| Solution 2 | |
| Solution 3 | Benjamin |
| Solution 4 | goks |
| Solution 5 | Dr. H. Lecter |
