Libpng12-0: Something happened between Cosmic and Disco

I encountered this error earlier, and while you may think this is a duplicate, this is an entirely new error I don't think anyone else has written about.

So get this, when I try to install the software in question I get this;

Get:1 [...]/libpng12-0_1.2.54-1ubuntu1_i386.deb libpng12-0 i386 1.2.54-1ubuntu1 [122 kB]
(Reading database ... 429607 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_i386.deb ...
Unpacking libpng12-0:i386 (1.2.54-1ubuntu1) ...
dpkg: error processing archive [...]/libpng12-0_1.2.54-1ubuntu1_i386.deb (--unpack):
 unable to install new version of '/usr/lib/i386-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while processing:
 [...]/libpng12-0_1.2.54-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Why? I need this for a piece of software known as zsnes and I prefer to use version 1.42.

Yeah, I tried to install it and failed. Perhaps this may help in installing your file.

https://ubuntu.pkgs.org/16.04/ubuntu-main-i386/libpng12-0_1.2.54-1ubuntu1_i386.deb.html

Good luck tiox.

I believe I had already tried that. Will see if libpng16 needs to be removed first.

I can reproduce the problem using package from xenial-updates even on minimal 19.10 system

cd ~/Downloads
wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_i386.deb
sudo apt install ./libpng12-0_1.2.54-1ubuntu1.1_i386.deb

it ends with

Unpacking libpng12-0:i386 (1.2.54-1ubuntu1.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-GceDPS/6-libpng12-0_1.2.54-1ubuntu1.1_i386.deb (--unpack):
 unable to install new version of '/lib/i386-linux-gnu/libpng12.so.0': No such file or directory
Errors were encountered while processing:
 /tmp/apt-dpkg-install-GceDPS/6-libpng12-0_1.2.54-1ubuntu1.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I would suggest to use Ubuntu MATE 18.04 LTS for serious work and gaming :slight_smile:
Libpng 1.2 installs here normally.

1 Like

Hey guys I figured it out~

...At least, for my use case. So right, I made a fake i386 package of a higher version according to apt in Ubuntu MATE 18.04.3 i386 using equivs with the control file from libpng12-0_1.2.54-1ubuntu1_i386.deb obtainable from Ubuntu Packages for Xenial as a base.

After making this fake package with no library files in it, I installed it in Ubuntu MATE 19.10, then while installing zsnes_1.420-2ubuntu1_i386.deb that package pulled in every other 32-bit dependency it needed.

I tried symlinking the 64-bit libpng16-0 files into the 32-bit directory but it turned out to be the incorrect ELF class (no surprises there, thought I was being clever) but after copying i386-linux-gnu/ from libpng12-0_1.2.54-1ubuntu1_i386.deb into /usr/lib/ everything worked.

So what now?

I believe for a proper resolution to this issue, the original libpng12-0 package from xenial needs a repack with a control file that doesn't make apt fly off the handle about installing it. My method is supremely cludgy but I will leave it to someone else to build a proper package for it.

1 Like

As the title alludes to, something did indeed happen between these two revisions. The jump from 18.04 to 18.10 added something apt doesn't like when it attempts to install libpng12.0:i386. Could it be, this is when libpng16:amd64 was introduced, and that's truly the conflict at hand here?

In the control file for libpng12-0:i386 (Canonical's copy from Ubuntu Xenial) this is what's in its control file:

Conflicts: libpng12-dev (<= 1.2.8rel-7), mzscheme (<= 1:209-5), pngcrush (<= 1.5.10-2), pngmeta (<= 1.11-3), povray-3.5 (<= 3.5.0c-10), qemacs (<= 0.3.1-5)
Replaces: libpng12-dev (<= 1.2.8rel-7)

But that's saying the conflict is for any version of libpng12-dev and the offending library I theorize may be the issue is libpng16-16. That shouldn't be a problem.

So what's really going on here?