New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 17.04 libpng12.so.0: cannot open shared object file #95

Closed
maraisr opened this Issue Apr 30, 2017 · 17 comments

Comments

Projects
None yet
@maraisr

maraisr commented Apr 30, 2017

Given this ticket somewhat relates to #76 I decided to re-create becuase we're now at version 17.04 with still no fix?

Error message:

Module build failed: Error: /home/myApp/node_modules/mozjpeg/vendor/cjpeg:
error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

From what I can see I'd need to contact you guys?


OS: Ubuntu 17.04
Version:: mozjpeg v4.1.1

Package: sudo apt-get install libpng-dev ran with no errors:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpng-dev is already the newest version (1.6.28-1).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
@olalonde

This comment has been minimized.

olalonde commented Jun 19, 2017

Anyone knows a work around?

@tcoopman

This comment has been minimized.

Owner

tcoopman commented Jun 19, 2017

As you can see, it's a problem with the dependency (mozjepg) and there is no current fix fo this. imagemin/mozjpeg-bin#18. At mozjepg you can find a possible workaround: mozilla/mozjpeg#255

Closing because this project can't fix this.

@tcoopman tcoopman closed this Jun 19, 2017

@olalonde

This comment has been minimized.

olalonde commented Jun 19, 2017

Ah ok, using this as a workaround:

wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
  && dpkg -i /tmp/libpng12.deb \
  && rm /tmp/libpng12.deb
@balaindin

This comment has been minimized.

balaindin commented Sep 21, 2017

Another workaround :)

 cd dpkg -i libpng12-0_1.2.50-2+deb8u2_amd64.deb; apt-get install -f
 sudo ln -s libpng16.so.16.28.0 libpng12.so.0
@Arbitr108

This comment has been minimized.

Arbitr108 commented Nov 2, 2017

what if libpng-dev:amd64 is already installed (debian 9) and still
"/mozjpeg/vendor/cjpeg: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory"?

@ghost

This comment has been minimized.

ghost commented Nov 27, 2017

Same problem on Debian 9.

@majamusan

This comment has been minimized.

majamusan commented Dec 18, 2017

i recommended

wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
  && sudo dpkg -i /tmp/libpng12.deb \
  && rm /tmp/libpng12.deb
@VladimirVaivada

This comment has been minimized.

VladimirVaivada commented Dec 31, 2017

Sorry my English... I just installed mozjpeg@5.0.0 package and delete old mozjpeg@4.1.1 from image-webpack-loader node_modules. And it works!
I had the same error message: ". . . /mozjpeg/vendor/cjpeg: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory"
I am on Debian 9.3 with libpng16

@Nexxado

This comment has been minimized.

Nexxado commented Feb 12, 2018

Downgrading image-webpack-loader to v3.6.0 solved it for me:
yarn add image-webpack-loader@^3.6.0

@mikeherrera

This comment has been minimized.

mikeherrera commented Mar 22, 2018

I got passed this on CentOS 7 through a combination of a lot of cursing and yum install libpng12.x86_64 libpng12-devel.x86_64 I didn't have to remove the newer libpng packages either.

@slamorte

This comment has been minimized.

slamorte commented Jun 20, 2018

None of the above fixes worked for me.

This one-liner solved it:

echo "deb http://mirrors.kernel.org/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list && sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

This installed libpng12 and doesn't require uninstalling libpng-dev (16.34 as of this comment). The issue appears to reside in a node package or webpack configuration and I wish it could be resolved there. In the meantime loading an old, outdated, buggy revision of libpng allows the build to proceed.

@bpauldun

This comment has been minimized.

bpauldun commented Jul 10, 2018

@slamorte Nice one. This fix works great. Thank you

@samsuits

This comment has been minimized.

samsuits commented Jul 16, 2018

Thanks @slamorte. Your fix worked for me. Cheers !!

@joscha

This comment has been minimized.

joscha commented Sep 11, 2018

echo "deb http://mirrors.kernel.org/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list && sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

Does this solution work for anyone in sid? I can't seem to get it installed due to

Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--install):
 unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
Processing triggers for libc-bin (2.27-6) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
@robotshateme

This comment has been minimized.

robotshateme commented Oct 5, 2018

"echo "deb http://mirrors.kernel.org/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list && sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0"
Worked for me.

@matheusfrancisco

This comment has been minimized.

matheusfrancisco commented Oct 9, 2018

Ah ok, using this as a workaround:

wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
  && dpkg -i /tmp/libpng12.deb \
  && rm /tmp/libpng12.deb

work to me on debian 9.4

@ErwinCraps

This comment has been minimized.

ErwinCraps commented Oct 17, 2018

None of the above fixes worked for me.

This one-liner solved it:

echo "deb http://mirrors.kernel.org/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list && sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

This installed libpng12 and doesn't require uninstalling libpng-dev (16.34 as of this comment). The issue appears to reside in a node package or webpack configuration and I wish it could be resolved there. In the meantime loading an old, outdated, buggy revision of libpng allows the build to proceed.

Worked for me on Ubuntu 18.04.1 LTS which is Hyper-V Win 10 Quick create one.
I needed this because ODOO has issues generating mail/pdf's at least in the sales module.
Thank you.

mejjjor added a commit to Parsys-Telemedicine/dockerfiles that referenced this issue Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment