I've faced this issue in the earlier Ubuntu's versions and was able to install libpng12.so.0 without any problem.

But in the latest Ubuntu 19.04 I cannot install it...

What I have tried:

  1. Download and installed it locally

    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
  2. Created a symlink

    ln -s /usr/lib/x86_64-linux-gnu/libpng16.so.16 /usr/lib/x86_64-linux-gnu/libpng12.so.0
  3. Added new repository and installed via apt

    echo “deb http://mirrors.kernel.org/ubuntu/ xenial main” >> /etc/apt/sources.list
    apt update
    apt install libpng12-0

All these workarounds don't work.

Could someone help me to solve this issue?

  • Define don't work, what went wrong? – Liso Apr 23 '19 at 7:58
  • 1
    I'm getting the following error: ./PacketTracer7: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory – Oleksandr Novozhylov Apr 23 '19 at 8:17
  • Works OK here : sudo apt install libpng12-0 ... ... Get:1 http://dk.archive.ubuntu.com/ubuntu xenial/main amd64 libpng12-0 amd64 1.2.54-1ubuntu1 [116 kB] ... so the package is actually in "main". ( One search said 'xenial-security', the other 'xenial-updates'.) – Knud Larsen Apr 23 '19 at 14:29
  • Doesn't work for me... – Oleksandr Novozhylov Apr 23 '19 at 18:55

I finally got what was causing the error, and fixed it.

You can download the new packages here:

https://www.dropbox.com/s/79x3imq73tcqyw4/libpng12-0_1.2.54-1ubuntu1b_amd64.deb?dl=0 https://www.dropbox.com/s/yhk1p83b2e7rvt4/libpng12-0_1.2.54-1ubuntu1b_i386.deb?dl=0

So, basically the problem comes from the architecture of the packet and the architecture of Ubuntu's /lib and /usr/lib folders. On the previous releases /lib and /usr/lib were 2 distinct folders, but on Ubuntu 19.04 /lib is a symlink to /usr/lib.

Now, take libpng12-0_1.2.54-1ubuntu1_amd64.deb as an example.
This is the deb architecture (I'll show only the binaries):

/lib/x86_64-linux-gnu/libpng12.so.0 (symlink)
/usr/lib/x86_64-linux-gnu/libpng12.so.0 (symlink)

This creates a conflict when unpacking in Ubuntu 19.04 because it tries to write two times libpng12.so.0 at the same place, which is impossible with apt.

What I did is simply a repacking of the files with this architecture:

/usr/lib/x86_64-linux-gnu/libpng12.so.0 (symlink)

If you don't trust my packages (and I would understand), you can simply compare the checksums of the files with those from the original packet.

  • 1
    Thanks, but I wouldn't download a package from a random post and I wouldn't expect anyone else to either. Can you edit to explain what the problem was and how you fixed it, please? – Zanna May 23 '19 at 1:39
  • 1
    You're right, I'll explain what I did. – Idechix Jun 6 '19 at 18:20
  • Thank you so much! worked for me... – Kushagra Sharma Jun 18 '19 at 8:11
  • I had to download and complied the source and copy the files to the locations – Sergio Nov 15 '19 at 20:46

Download libpng12-0_1.2.54-1ubuntu1.1_amd64.deb, extract it, then copy libpng12.so.0, libpng12.so.0.54.0 from data.tar.gz folder to /usr/lib/x86_64-linux-gnu/

  • now I have this error: ./PacketTracer7: ./libcrypto.so.1.0.0: no version information available (required by ./PacketTracer7) Segmentation fault (core dumped) I haven't found solutions of how to fix it. – Oleksandr Novozhylov May 14 '19 at 19:45
  • I had to download and complied the source and copy the files – Sergio Nov 15 '19 at 20:46

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