Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

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

Closed
maraisr opened this issue Apr 30, 2017 · 31 comments
Closed

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

maraisr opened this issue Apr 30, 2017 · 31 comments

Comments

@maraisr
Copy link

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
Copy link

Anyone knows a work around?

@tcoopman
Copy link
Owner

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.

@olalonde
Copy link

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
Copy link

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
Copy link

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
Copy link

ghost commented Nov 27, 2017

Same problem on Debian 9.

@majamusan
Copy link

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
Copy link

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

@ndraiman
Copy link

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

@mikeherrera
Copy link

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.

@campaignupgrade
Copy link

campaignupgrade 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
Copy link

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

@samsuits
Copy link

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

@joscha
Copy link

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
Copy link

"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
Copy link

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
Copy link

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.

@tomwj
Copy link

tomwj commented Jan 2, 2019

Ended up here from Arch ( Manjaro ). This fixed it.
sudo pacman -S libpng12

@Fourteen98
Copy link

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.

Thank you Erwin, it solved mine

@kupoback
Copy link

kupoback commented May 1, 2019

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.

Thank you Erwin, it solved mine

Thank you as well. Worked for me on Ubuntu 18.04

@campaignupgrade
Copy link

campaignupgrade commented Jul 15, 2019

Recently my deploy process starting throwing errors regarding keys.

This new three-line bash fixes that issue:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
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
sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

@campaignupgrade
Copy link

If anyone has a better fix, perhaps using a new version of mozjepg, I'd be happier to replace this hacky fix.

@shaohuaXu
Copy link

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.

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.

I tried this one and it worked . Thanks~~~

@amayer-glei
Copy link

Getting this error now with node:8 Docker image in a multistage build...

@trickdgrit
Copy link

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

i try this one and it's working for me in my ubuntu 18.04, thank you.

@bini414
Copy link

bini414 commented May 20, 2020

finally this help me in kali linux 2020

This new three-line bash fixes that issue:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
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
sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

@brilliant-smart
Copy link

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.

I got this error:
unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such
file or directory
Errors were encountered while processing:
/var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
Scanning application launchers
Updating active launchers
Done
E: Sub-process /usr/bin/dpkg returned an error code (1)

@brilliant-smart
Copy link

None of the above fix worked for me, I am using parrot 5.4

@ghost ghost mentioned this issue Oct 23, 2020
@shrutikabongarde
Copy link

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.

its really awesome>>> Worked for me

@delmicio
Copy link

delmicio commented May 26, 2021

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
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
sudo apt-get update && sudo apt install -y --allow-unauthenticated libpng12-0

unfortunately it fails on ARM (M1)

#9 5.976 Executing: /tmp/apt-key-gpghome.UZHJx72Pfg/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
#9 24.31 gpg: key 3B4FE6ACC0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" imported
#9 24.32 gpg: Total number processed: 1
#9 24.32 gpg:               imported: 1
#9 24.69 Warning: apt-key output should not be parsed (stdout is not a terminal)
#9 24.71 Executing: /tmp/apt-key-gpghome.PAeVaxx5ot/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
#9 25.80 gpg: key 40976EAF437D05B5: public key "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>" imported
#9 25.81 gpg: Total number processed: 1
#9 25.81 gpg:               imported: 1
#9 26.18 deb http://mirrors.kernel.org/ubuntu/ xenial main
#9 26.53 Hit:1 http://security.debian.org/debian-security buster/updates InRelease
#9 26.53 Hit:2 http://deb.debian.org/debian buster InRelease
#9 26.54 Hit:3 http://deb.debian.org/debian buster-updates InRelease
#9 30.12 Get:4 http://mirrors.edge.kernel.org/ubuntu xenial InRelease [247 kB]
#9 33.83 Ign:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 34.50 Ign:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 38.79 Ign:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 39.46 Ign:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 40.04 Ign:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 40.77 Err:5 http://mirrors.edge.kernel.org/ubuntu xenial/main arm64 Packages
#9 40.77   404  Not Found [IP: 147.75.197.195 80]
#9 40.79 Fetched 247 kB in 15s (16.9 kB/s)
#9 40.79 Reading package lists...
#9 41.15 E: Failed to fetch http://mirrors.edge.kernel.org/ubuntu/dists/xenial/main/binary-arm64/by-hash/SHA256/3148af0f0133dbef92669209f1d85fdd47498ba5005080571bc515027f1a335c  404  Not Found [IP: 147.75.197.195 80]
#9 41.15 E: Some index files failed to download. They have been ignored, or old ones used instead.

@AdrienPoupa
Copy link

It looks like mozjpeg-bin was updated to use libpng 16 from 7.1.0. I guess pinning mozjpg dependency to "^7.1.0" would solve it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests