Updating libpng on Ubuntu

1

0

I had a need to run the Ubuntu libpng utility convert, and when I did I got an error message that my version of libpng was out of date and had to be updated. So, I went the usual route of apt-get install, but for reasons I now no longer remember, this didn't solve the problem. This is where things got messy.

I downloaded the source for libpng, did a make, and a make install. While a shareable library was created in /usr/local/lib, convert now reports:

convert: error while loading shared libraries: libpng.so.2: cannot open shared object file: No such file or directory

On the advice of a helpful person elsewhere on StackExchange, I tried apt-get install again, attempting to get and install the packages libpng12-dev and libpng12-0. However, both attempts generated the messages

libpng12-dev is already the newest version
libpng12-0 is already the newest version

...and so nothing was installed. Probably my clumsy attempts with making the source have screwed things up. Is there some way I clean things up? For example, installing an older version of libpng and then installing the latest version?

Later:

On dogbert's suggestion, I consulted the article at https://www.debian-administration.org/article/176/Reinstalling_packages_to_fix_problems and discovered that I could force the deletion of a package without blowing away all the dependent packages as well:

dpkg --purge --force-depends libpng12-0

So, I did that, and then re-installed libpng12-0. However, convert still reports the same error. Okay, maybe I need to reinstall convert since possibly the libpng12-0 library is not where it is expected to be. convert is part of imagemagick, so I uninstalled it. However, convert was still available at the command line, so uninstalling imagemagick doesn't get rid of it. Re-installed imagemagick. Same results: convert still complains that it can't find libpng.so.2.

Searched the entire hard drive and found that no file libpng.so*exists anywhere. Apparently installing the package isn't creating the needed file.

Peter P

Posted 2015-09-12T16:32:49.667

Reputation: 11

Answers

0

libpng.so.2 is supposed to be the shared library for libpng-1.0.x (current version is 1.0.63). You have "convert" (part of imagemagick) that apparently was built with libpng-1.0.x, so you need to remove and reinstall imagemagick via apt-get. Once that is working, you can try again to install a newer version of imagemagick, from imagemagick.org, which should work ok with libpng12.

Glenn Randers-Pehrson

Posted 2015-09-12T16:32:49.667

Reputation: 477