Fix libpng12-0 Missing In Ubuntu 18.04 Or 18.10, Preventing Apps Like WPS Office From Installing

In this article you'll find a very easy to apply fix that will allow installing and running applications that depend on libpng12-0 in Ubuntu 18.04 LTS (or Linux Mint 19, which is based on Ubuntu 18.04), as well as Ubuntu 18.10. This applies to any Ubuntu or Linux Mint flavor: Kubuntu, Xubuntu, Ubuntu MATE, Ubuntu Budgie, Linux Mint Xfce, Linux Mint Cinnamon, etc.

The problem

libpng12 is no longer available in the Ubuntu repository archives and as a result, some applications that were not built with the newer libpng (libpng16) library fail to install. This issue is not new, since Ubuntu dropped libpng12 with version 16.10, but those whom are upgrading from Ubuntu 16.04 to 18.04 LTS or 18.10, as well as Linux Mint 19 users, might not be aware of this and how to fix it.

Here is an example. Ubuntu Software simply fails to install WPS Office, without displaying any error message, so I opened the WPS Office deb with gdebi-gtk, which doesn't allow the deb to install, displaying this message: "Error: Dependency is not satisfiable: libpng12-0":

libpng12-0 error Ubuntu

Trying to install the same deb from a terminal results in the following libpng12-0 error:

logix@logix-laptop:~$ sudo dpkg -i wps-office_10.1.0.5707_a21_amd64.deb 
[sudo] password for logix: 
Selecting previously unselected package wps-office.
(Reading database ... 354579 files and directories currently installed.)
Preparing to unpack wps-office_10.1.0.5707_a21_amd64.deb ...
Unpacking wps-office ( ...
dpkg: dependency problems prevent configuration of wps-office:
 wps-office depends on libpng12-0; however:
  Package libpng12-0 is not installed.

dpkg: error processing package wps-office (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:

Note that some apps can't be installed due to missing libpng12-0, while others simply fail to start.

The fix: install and run applications that require libpng12-0 in Ubuntu 18.04, Ubuntu 18.10 or Linux Mint 19

To fix the issue, download the libpng12-0 package for your architecture (you only need one of these, specific for your Ubuntu / Linux Mint architecture):

Install the libpng12-0 deb downloaded by using the link above, and you should be able to install and run applications that still depend on this library, in Ubuntu 18.04 LTS or Ubuntu 18.10 / Linux Mint 19.