10

Blackmagic Design's Resolve video editor, V14.0.1, requires libpng12. Unfortunately, only libpng16 is provided with the new 17.10 release.

Is there a way to revert to libpng12 under 17.10? If so, how do I get libpng12 - synaptic doesn't list it when I search for it.

  • 1
    Contact Blackmagic and file a bug report. blackmagicdesign.com/support – Panther Oct 20 '17 at 13:32
  • instead of installing obsolete packages to the system, they can also be placed adjacent to closed source binaries that depend on the without bundling them. Use ldd ./path/to/<program> to show the libraries the given binary will try to load. Compile or download the obsolete libraries either adjacent to the binary or manipulate envron LD_LIBRARY_PATH to include them. Beware, any software not distributed by your maintainer's package repository is not going to get security updates from thier security team; you're going to have to manually update the library yourself, four times a day is ideal :) – ThorSummoner Jan 3 at 6:50
14

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.

  • You are sort of on the right track and this may work for simple packages. Mixing packages from different repositories is likely , however, to result in a broken system due to conflicting dependencies and the probability of a broken system increases with the number and complexity of the packages in question. Furthermore, installing via dpkg will only last until the next sudo apt upgrade, you would have to put the imported package on hold. Better off compiling libping12 and installing it in say /usr/local . – Panther Oct 20 '17 at 13:35
  • I agree, this solution does not work with all the packages you may need -- In concrete, I tried this in a recently installed Ubuntu 17.04 that had the libpng16-16 package before installing libpng12 for answering this question. Both libraries resulted installed. I did an apt-get upgrade at the end. -- Right now, I think the rules in the repository does not consider libpng16 as a recent version of libpng12. In turn, libpng12 only depends on libc6 (>= 2.14) and zlib1g (>= 1:1.1.4). -- I think this solution for libpng12 may be safe for using apt-get update. – Jaime Oct 20 '17 at 13:56
  • There are lots of changes between 16.04 and 17.10 and mixing packages from repositories is one of the many ways to break Ubuntu or more specifically apt. – Panther Oct 20 '17 at 13:57
  • Do you think that installing a package that only depends on libc6 and xzlib1g (that exists in 17.x), which is independent of the included libpng library, and which no other package depend on it, can break the apt? -- I think that programs such as WPS and the Resolve video editor depends on the (old) libpng12 and they will not result hold. Recent Ubuntu programs does not depend on libpng12 but libpng16-16. These apps will not be hold neither. -- For this concrete case, I think this solution is safe. – Jaime Oct 20 '17 at 14:07
  • 1
    In this case, it will indeed not break Apt. However, another issue is that if an updated version of libpng12 is uploaded to the 16.04 repositories, you will not automatically get this update, which is a concern especially if it is security-related. This can be fixed by adding the 16.04 repositories to your sources list and using apt-pinning so they are used only for libpng12 (assigning priority < 100 to all other packages). – fkraiem Nov 20 '17 at 12:41
3

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.

0

IMO you are safer compiling from source than you are using old packages from old repositories.

Best advice I can give you is to file a bug report with blackmagic, they need to update their dependencies.

https://www.blackmagicdesign.com/support/

To compile, go to the relevant ubuntu package to identify the package and upstream source

https://packages.ubuntu.com/xenial/libpng12-0

So you want "libpng_1.2.54.orig.tar.xz"

https://sourceforge.net/projects/libpng/files/libpng12/older-releases/1.2.54/

download, extract, compile, install (starting after download and extracting the tar ball).

cd libpng-1.2.54
./configure --prefix=/usr/local
make
sudo make install

To remove again (if needed)

#run within libpng-1.2.54 directory
sudo make uninstall

I understand it seems like a few extra steps, but it is trivial to download and compile in this way and there is no risk of breaking apt.

  • If you compile the original source code and do the make install, the .deb installer will not find the dependency to libpng-12 as met. The installer will fail. -- This solution will work if you can get access to the source code or other type of installer for the software. -- If you cannot get the source code, you may compile the sources for the Ubuntu package and install the resulting file before installing the software you want. – Jaime Oct 20 '17 at 19:43
  • I've given up the idea. It's really just a band-aid for a program from a vendor who's ...um... somewhat difficult to work with. It's a pity, as the product has a lot going for it. Oh well... moving on... – Richard Emerson Oct 21 '17 at 15:57
0

This source worked for me on Ubuntu 18:

sudo echo 'deb http://cz.archive.ubuntu.com/ubuntu trusty main universe' \ > /etc/apt/sources.list.d/extra.list
sudo apt update
sudo apt-get install libpng12-0
sudo rm /etc/apt/sources.list.d/extra.list

Found it here while trying to install printer drivers and it seems to be working.

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.