Skip to content
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

Installation fails on Ubuntu 16.10 amd64 #18

Closed
bigslycat opened this issue Oct 31, 2016 · 18 comments
Closed

Installation fails on Ubuntu 16.10 amd64 #18

bigslycat opened this issue Oct 31, 2016 · 18 comments

Comments

@bigslycat
Copy link

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

I fixed it by installing libpng12 but it is not true way.

@bigslycat bigslycat changed the title Installation fails on Ubuntu 16.10 Installation fails on Ubuntu 16.10 amd64 Oct 31, 2016
@kevincaradant
Copy link

Hi

Same problem for me. Thanks for the workaround

@mitjade
Copy link

mitjade commented Jan 6, 2017

Same problem on Mac OS. I'm using MacPorts and installing libpng did not help.

@ghost
Copy link

ghost commented Jan 20, 2017

This worked for me! installing http://ppa.launchpad.net/hiberis/ppa/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.27-1ubuntu1~ppa1_amd64.deb

@korndorben
Copy link

@jeremiahgibson91 thanks, it works

JBlaak added a commit to JBlaak/Provisioning that referenced this issue May 11, 2017
imagemin/mozjpeg-bin#18 which is used by img-loader (webpack), which is used by laravel-mix
@mavsan
Copy link

mavsan commented May 23, 2017

Same issue, Kubuntu 16.10.
@jeremiahgibson91 it works.
But it's not right.

@bigslycat
Copy link
Author

What about to implement platform-adaptive library calls?

@olalonde
Copy link

Potential 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

@juanchopalen
Copy link

Hi @jeremiahgibson91, it works for me in Ubuntu 17.04, thanks!!!

@DevSide
Copy link

DevSide commented Feb 28, 2018

I'm encountering the same problem with libpng16.so on different Linux platforms.

I had to fix this by running
sudo apt-get install libpng16-dev or sudo apt-get install libpng16-16

@hackel
Copy link

hackel commented Mar 7, 2018

I also ran into this issue. imagemin/imagemin-mozjpeg#26 pointed me to the fact that nasm needed to be installed, after which the package built from source just fine instead of using the outdated binary.

First, make sure you have all the build dependencies installed:
sudo apt-get install autoconf libtool pkg-config nasm build-essential

Then just rebuild the package:
npm rebuild mozjpeg

@vladcosorg
Copy link

vladcosorg commented Mar 7, 2018

@hackel It worked, thanks!

@campaignupgrade
Copy link

campaignupgrade commented Jun 20, 2018

The above fixes didn't work for me on my deployment process docker image.

The one-line command 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

Basically it adds another source to apt, updates apt, and installs libpng12-0.

@poudelmadhav
Copy link

Potential 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

This works for me, Very very thank you!

@JettBurns14
Copy link

I also had the libpng12.so.0 issue, and fixed with:

wget http://ppa.launchpad.net/hiberis/ppa/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.27-1ubuntu1~ppa1_amd64.deb
sudo dpkg -i libpng12-0_1.2.27-1ubuntu1~ppa1_amd64.deb
sudo apt-get update

elementary OS 5.0 Juno (64-bit)
Built on Ubuntu 18.04.2 LTS
Linux 4.15.0-51-generic
GTK+ 3.22.30

This answer gave the general commands. Thanks @jeremiahgibson91 for the install link!

@ekeric13
Copy link

ekeric13 commented Jul 1, 2020

It is not just ubuntu that dropped support for libpng12, but also Debian. Debian Jessie seems to be the last version that supports libpng12, and will no longer be LTS starting today (june 30th 2020). Given that debian is the de-facto base for the popular node images... yet mozjpeg-bin/vendor/linux/cjpeg still explicitly looks for libpng12, can there be a major version bump to change the binary to expect libpng version 1.6? Or better yet be backwards compatible?

The imagemin is widely popular in the node community. If you want to use the latest node versions via docker you can no longer use imagemin. It would be great if they could be aligned.

Also it seems the macos cjpeg binary is expecting the more recent libpng version 1.6 as well, and not libpng12. So if you develop on a mac and then deploy code in linux (a common pattern) there is further confusion of what version of libpng is needed.

@tomaszkrzyzanowski
Copy link
Contributor

Hello

I have probably a proper resolution for this problem. The build image for cjpeg is an ancient debian:8-slim image (so 2 versions behind current stable)

So I updated the image and after rebuild and swap binaries everything seems to work on the current Debian 10 Slim image

https://github.com/imagemin/mozjpeg-bin/pull/61/files

@tomaszkrzyzanowski
Copy link
Contributor

I'm glad that the PR was merged so fast!!! ^^

@sindresorhus @1000ch when you are going to release a new version? I would like to start using the libpng16 compatible version as soon as possible ^^

@1000ch
Copy link
Contributor

1000ch commented Oct 28, 2021

The newest version uses libpng16. Please install mozjpeg-bin with related dependencies.

@1000ch 1000ch closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests