Libpng12 needed for 17.10

There are Ubuntu packages for libpng12-0 for trusty (14.04LTS) and xenial (16.04LTS), but not for 17.10. You must ask to the software manufacturer (i.e. Blackmagic Design) to update the program and/or the installer to use the most recent libpng16-16.


As a workaround, you may download and install the .deb package for Xenial from the Ubuntu web page before installing the Blackmagic Design's Resolve video editor.

  • Installing libpng12

    $ wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
    $ sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
    

NOTE: Installing packages from older distributions may break your apt installation system.


Is it safe to install the libpng12 package from Xenial (16.04LTS) ?

Using packages from older distributions can be dangerous. It may break the apt installation system because older packages may introduce dependencies to non-existing packages or replace packages that the new versions require. Try to use packages and repositories for the Ubuntu version you are using, i.e., the official Ubuntu repositories and well-known PPA repositories (that test their packages).

To check if the installation of libpng12 can break the apt, I checked the package information.

  • The libpng12 depends on libc6 (>= 2.14) and zlib1g (>= 1:1.1.4) that are included in the recent Ubuntu versions.

    $ apt-cache policy libc6     # gives me 2.24-9ubuntu2.2
    $ apt-cache policy zlib1g    # gives me 1.2.11dfsg-0ubuntu1
    
  • Note that no other Ubuntu package requires a recent version of libpng12 because it is not included in the repository. The most recent programs depends on libpng16-16 and both libraries can coexist.

  • I think that it is very unlikely that this package breaks the apt.

Do not try to install a package of an older distribution if you are not sure of what you are doing.


Instead of using the binary package, you may compile libpng.

  • If you have the source code of the program you wanna install, you can use the original source code. After installing the library, you can use it to configure and compile other applications.
  • If you do not have the source code of the program but only a .deb installer, e.g., if the program is a commercial product, you must install a package to avoid errors during the installation. You can create the package from source code using instructions below.

Compiling libpng from the official source code

Note that old libpng v1.2.x may have a lot of vulnerabilities. It is recommended to use the most recent 1.2.x version from sourceforge or github. This is for the v.1.2.59 version.

  1. Install the packages to compile software (if they are not installed)

    $ sudo apt-get install build-essential
    
  2. Obtain and extract the source code

    $ wget https://github.com/glennrp/libpng/archive/v1.2.59.tar.gz
    $ tar xvfz v1.2.59.tar.gz 
    
  3. Compile and install the library

    $ cd libpng-1.2.59/
    $ ./configure
    $ make check
    $ sudo make install
    

NOTE: Installing the library will not set the dependency to libpng12 as met in apt. You must use a .deb package to install it and support the installation of other .deb files that depend on it. To create the corresponding .debpackage, you can use the following instructions.


Using the source code of the Ubuntu package

the libpng12-0 package corresponds to libpng 1.2.54. Ubuntu has a customized version they named 1.2.54-1ubuntu1.

  1. Install the packages to compile software and create Ubuntu packages (if they are not installed)

    $ sudo apt-get install build-essential fakeroot dpkg-dev devscripts
    
  2. Download source code files using the .dsc file from the page

    $ dget -d http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54-1ubuntu1.dsc
    
  3. Extract the source code applying the patched provided by Ubuntu

    $ dpkg-source -x libpng_1.2.54-1ubuntu1.dsc 
    
  4. Check the dependencies for the package

    $ cd libpng-1.2.54/
    $ dpkg-buildpackage -rfakeroot -b
    

    It shows unmet build dependencies. In my case...

     :
    dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 8.1.3) libtool automake autoconf zlib1g-dev
    
  5. Install the dependencies

    $ sudo apt-get install debhelper libtool automake autoconf zlib1g-dev
    
  6. Compile

    $ fakeroot debian/rules binary
    

    The resulting packages will be located in the parent folder

    ../libpng12-0_1.2.54-1ubuntu1_amd64.deb
    ../libpng12-dev_1.2.54-1ubuntu1_amd64.deb
    ../libpng3_1.2.54-1ubuntu1_amd64.deb
    
  7. Use the resulting package

    $ cd ..
    $ sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
    

NOTE: Compiling and installing packages for old distributions is as dangerous as using binary packages for old distributions. The described compilation process for the libpng12 package uses only packages in the Ubuntu 17.x repositories and does not result in errors. I think that using the resulting package will not break the apt.