I'm trying to install libgdal-dev:

sudo apt-get install libgdal-dev

But it has unmet dependencies: Depends: libpng-dev

Which itself cannot be installed because:

libpng12-dev : Depends: libpng12-0 (= 1.2.54-1ubuntu1.1) but 1.2.54-5x0~ppa is to be installed

This package is installed from a ppa:

dpkg -s libpng12-0 | grep ^Maintainer
Maintainer: Otto Meier <otto@kesselgulasch.org>


I want to keep that ppa as it provides GIMP 2.9.


  • How can I install libpng12-dev and libgdal-dev (maybe ignoring or manually changing certain dependencies) ?

  • or generally: How to install packages when dependency is already installed in another version from PPA ?

(Hint: Installing GIMP with Snap is neither preferred nor possible)

What I tried:

I installed libpng12-dev ignoring libpng12-0 dependecy (via):

apt download libpng12-dev
sudo dpkg --ignore-depends=libpng12-0 -i libpng12-dev_1.2.54-1ubuntu1.1_amd64.deb

This worked.
Also, libgdal-dev still had unmnet dependencies, so I did the same:

sudo apt install libgdal-dev
sudo dpkg --ignore-depends=libpng12-0 -i libgdal-dev_2.2.2+dfsg-1~xenial1_amd64.deb #png12-dev_1.2.54-1ubuntu1.1_amd64.deb

dpkg: dependency problems prevent configuration of libgdal-dev:
 libgdal-dev depends on libarmadillo-dev; however:
  Package libarmadillo-dev is not installed.
 libgdal-dev depends on libcurl4-gnutls-dev | libcurl-ssl-dev; however:
  Package libcurl4-gnutls-dev is not installed.
  Package libcurl-ssl-dev is not installed.
 libgdal-dev depends on libdap-dev; however:
  Package libdap-dev is not installed.
 libgdal-dev depends on libepsilon-dev; however:
  Package libepsilon-dev is not installed.
 libgdal-dev depends on libfreexl-dev; however:
  Package libfreexl-dev is not installed.
 libgdal-dev depends on libfyba-dev; however:
  Package libfyba-dev is not installed.
 libgdal-dev depends on libgeos-dev; however:
  Package libgeos-dev is not installed.
 libgdal-dev depends on libgeotiff-dev; however:
  Package libgeotiff-dev is not installed.
 libgdal-dev depends on libgif-dev; however:
  Package libgif-dev is not installed.
 libgdal-dev depends on libhdf4-alt-dev; however:
  Package libhdf4-alt-dev is not installed

So, I stopped here and fixed the situation again:

sudo dpkg -r libgdal-dev
sudo dpkg -r libpng12-dev
  • 1
    forgot about that, updated tags.
    – pLumo
    Aug 28 '18 at 8:42
  • Thanks for the hint. Indeed that is the root cause of my problem => Leftovers from the ppa installed earlier.
    – pLumo
    Aug 28 '18 at 9:38

@dsstorefile1 gave the right hint to fix my issue:

The ppa I linked in the question was made for 16.04 when I installed it, but it changed and the the maintainer removed most packages for xenial including libpng12-0.

So this is how I fixed the situation:

  • Remove the ppa using ppa-purge:

    sudo ppa-purge ppa:otto-kesselgulasch/gimp
  • Downgrade the libpng12-0 package to the version from the official repos:

    sudo apt install libpng12-0=1.2.54-1ubuntu1.1
  • Install libgdal-dev:

    sudo apt install libgdal-dev

I also noticed that following packages are also leftovers from that ppa:


So, I also downgraded/removed these:

sudo apt install libbabl-0.1-0=0.1.16-1
sudo apt install libgegl-0.3-0=0.3.4-1ubuntu2
sudo apt install liblcms2-2=2.6-3ubuntu2
sudo apt remove libwebp6 #no candidate from repos
  • 1
    While this fixes my issue, the general question is still open.
    – pLumo
    Aug 28 '18 at 9:20
  • i followed your steps and i cannot get libpng12-0 package for artful, if that package for xenial, how i can get it sir? Aug 28 '18 at 9:41
  • 1
    First of all artful is EOL. Then, why do you follow my steps at all if you don't have the same issue?
    – pLumo
    Aug 28 '18 at 10:46

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.