7

Anytime I attempt to install libpng12-0 with this command:

sudo apt-get install libpng12-0

I get this returned:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gstreamer0.10-plugins-base libavformat53 libcdaudio1 libgcrypt11 libgnutls-deb0-28 libgnutls26 libgsoap5
  libgstreamer-plugins-bad0.10-0 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libhogweed2 libjasper1 libmimic0
  libmpg123-0 libnettle4 libpostproc52 libqt4-dbus libqt4-network libqt4-opengl libqt4-xml libqtcore4 libqtdbus4
  libqtgui4 librtmp0 libslv2-9 libsoundtouch0 libswscale2 libtasn1-3 libuv1 libvncserver0 libwildmidi1 qdbus
  qt-at-spi qtchooser qtcore4-l10n virtualbox-dkms
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 173 kB of archives.
After this operation, 273 kB of additional disk space will be used.
Get:1 http://debian.cc.lehigh.edu/debian jessie/main amd64 libpng12-0 amd64 1.2.50-2+deb8u2 [173 kB]
Fetched 173 kB in 0s (493 kB/s)    
(Reading database ... 182049 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.50-2+deb8u2_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.50-2+deb8u2) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.50-2+deb8u2_amd64.deb (--unpack):
 unable to install new version of '/usr/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.50-2+deb8u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have NO IDEA how to work around this. I do have libpng16-16 installed, but I don't see why that would cause an issue. I've tried everything from downloading the .deb manually and installing it to trying to symlink the libpng16-16 so to that location. All of it gave me no luck.

Anyone have any advice?

Further information: any attempt to symlink another .so into the path provided (/usr/lib/x86_64-linux-gnu/libpng12.so.0) results in the deletion of that symlink and the same error. The .so I was attempting to symlink as a fix, was libpng.so which is provided by libpng-dev (or libpng16-16).

6
  • Try sudo rm /var/cache/apt/archives/libpng12-0_1.2.50-2+deb8u2_amd64.deb, and then rerun apt. Dec 21, 2016 at 2:14
  • I've tried this and apt-get clean multiple times, in addition to grabbing the .deb directly off of the deb packaging site. Did it again, still no go, same error.
    – hjc1710
    Dec 21, 2016 at 2:17
  • You could potentially grab the source and build it. I'd suggest 1.2.56 (at a minimum), there is a list of vulnerabilities in earlier versions here. Dec 21, 2016 at 2:21
  • I think I'm going to give this another few days, or until I DIRELY need it, and then just build from source. This is driving me nuts and I can't even figure out what file or directory is missing during the unpack...
    – hjc1710
    Dec 21, 2016 at 2:27
  • Can you post the output of ls -l /usr/lib/x86_64-linux-gnu/libpng12.so.0? It's likely that the symlink there is broken, and that you need to manually fix it. Dec 21, 2016 at 9:52

5 Answers 5

7

I have this resolved now. I went to the Debian forums and asked my question here, where a helpful member pointed out that libpng12-0 isn't available for Stretch (should have specified my OS version earlier, sorry). I was trying to install the Jessie version, and that just... doesn't work with Stretch right now. There's a version of libpng12-0 in Sid, currently. It should make it's way to Stretch in the near future to solve this issue.

In the meantime, I abandoned installing the Jessie libpng12-0 package, and just did the Wheezy package, which is version 1.2.49 instead of 1.2.50, which worked like a charm. Until 1.2.50 is out for Stretch, I recommend installing Wheezy's 1.2.49.

Thanks again for the help to everyone who replied and commented, you all are truly wonderful human beings!

3
  • I needed this to install the Unity Editor on Debian Stretch, the Wheezy 1.2.49 version worked. Thanks!
    – Pierre
    Apr 5, 2017 at 14:09
  • Can you tell me how you installed the wheezy package? I've never had to do this sort of thing before.
    – Dark Star1
    Jan 11, 2018 at 0:36
  • 1
    I don't know what the exact version you need to install is, so that changes the output of the command, but you generally want to follow the instructions here: askubuntu.com/questions/428772/…, which will help you find the right version. Just look for the one that says wheezy where saucy/main is in that example link. Then just install it with: apt-get install libpng12-0=$VER. Paste apt-cache policy libpng12-0 output if you hit issues.
    – hjc1710
    Jan 12, 2018 at 2:18
3

You can download the libpng12-0 from.

http://packages.ubuntu.com/xenial/i386/libpng12-0/download for 386 architecture

and

http://packages.ubuntu.com/xenial/amd64/libpng12-0/download for 64 bits.

1
  • 1
    While I normally hate grabbing .deb's for other distros, I manually downloaded the 64 bit .deb for Ubuntu and receive the same error as described in the OP. Thanks for trying though!
    – hjc1710
    Dec 21, 2016 at 15:11
3

It looks like there's something a bit messed up with libpng12-0; it installs its .so in /lib/x86_64-linux-gnu (on amd64), but also drops a link in /usr/lib/x86_64-linux-gnu — and I think that's what's breaking here.

On my system everything is installed correctly (libpng16-16 and libpng12-0), but I also have libpng-dev installed (version 1.6), and that allows the libpng12-0 link to be resolved. If my theory is correct, you should be able to do

apt-get install libpng-dev
apt-get install libpng12-0

and have a working libpng12...

4
  • That was a really solid theory, because I didn't have libpng-dev installed. So, I have now installed it (1.6.26-6 is the exact version) and tried to rerun the install for libpng12-0, unfortunately, I received the same error =(. Any other ideas?
    – hjc1710
    Dec 21, 2016 at 15:12
  • Unfortunately not, I've tried removing and reinstalling libpng12-0 on my own system and it works fine, with and without libpng-dev. Dec 21, 2016 at 16:41
  • Thanks again for your help, but I figured it out. I'm running Stretch (testing), which doesn't have libpng12-0 out officially. I was trying to install Jessie's version (1.2.50). When I installed Wheezy's version (1.2.49), everything was fixed and it works like a charm. Appreciate your time though!
    – hjc1710
    Dec 21, 2016 at 16:54
  • I know, libpng16-16 is only available in testing and unstable, so I figured you were running at least testing; and libpng12-0 isn't available there any more. I tested with the Jessie version too... But if the Wheezy version works, that's good. You should probably try to get rid of the need for libpng12-0 entirely though, it does have a few security holes! Dec 21, 2016 at 16:58
0

You need to edit (as superuser) /etc/apt/sources.list and add a line deb http://ftp.de.debian.org/debian wheezy main then save this and enter next command sudo apt-get install libpng12-0 and your issue may be solved

1
  • 1
    Good idea, but it doesn't work for me. Mar 15, 2019 at 16:46
0

I was able to finally install this file into my kali build.

I had to download "libpng-1.2.49" the file that runs on debian 7 "wheezy" as a .tar.gz file.

extract it through the normal methods than using the readme was able to successfully install the file and get the desired result i was looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.