I'm completely new to Ubuntu. I got installed it because my school uses a lot of Linux type stuff in my school's Computer Science program so I figured I would use Ubuntu on my own machine and just do my code from there instead of the computer labs. However, I'm having a lot of trouble trying to install the numerous packages that aren't included natively on Ubuntu. Can someone help me install the PNG library, libpng and zlib. This is just one of many things I need to get on here but I think I need to first start off with this. I did download both packages, did the tar xf thingy on the download, and looked at the README files for insight on installing the software. I get weird errors though. I first tried installing libpng and the terminal was like zlib isn't installed so I was like ok, I'll just get zlib but permission is denied. Do I need to get root or something? I remember seeing people say root before, but I don't know if it is relevant. I'm really new so I don't understand a lot of these things and it's kinda scary. Please help.

2 Answers 2


Open terminal by CtrlAltT

For libpng, run:

sudo apt-get install libpng-dev

For zlib, run:

sudo apt-get install zlib1g-dev
  • tried # sudo apt-get install libpng-dev Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libpng12-dev' instead of 'libpng-dev' You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: ghostscript : Depends: libgs9 (= 9.14~dfsg-0ubuntu3) but 9.10~dfsg-0ubuntu10.4 is to be installed Apr 5, 2016 at 13:50
  • libpng12-dev : Depends: libpng12-0 (= 1.2.50-1ubuntu2.14.04.2) but 1.2.50-1ubuntu2 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). Apr 5, 2016 at 13:50
  • Got above error so should I go for "E: Unmet dependencies. Try 'apt-get -f install' Apr 5, 2016 at 13:51

Ubuntu uses a thing called apt, which is a package manager. It installs, manages, upgrades, and removes programs. If at all possible, you should try to install programs via Ubuntu Software Center. What you were likely attempting to do was install from source, which is only recommended if you know what you're doing.

Try to get out of the Windows mentality, which is to search google and download an installer. The Ubuntu Software Center searches Ubuntu's online repositories, which are generally guaranteed to work. Programs installed via Software Center or apt will also be updated automatically by Ubuntu's Software Updater.

You can install libpng from the Software Center by searching libpng and choosing "PNG Library - runtime". Or from here libpng12-0 Install steam-launcher by clicking "available on the Software Center". Or using sudo apt-get install libpng12-0 from a terminal.

The zlib1g package should be installed automatically when you install libpng12-0, because it is one of the libpng12-0 package's dependencies. The package manager apt installs all of a package's dependencies before it installs the package.

  • 4
    Your answer, while quite informative for a new user, doesn't actually say how OP is supposed to get the packages needed, and so doesn't answer the question. Could you either add commands like hwez has or instruct OP in using USC?
    – muru
    Aug 9, 2014 at 11:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .