Sorry, fairly n00b with Ubuntu. I've searched and tried a few results but not sure how I could add the repo into my Ubuntu 20.04 in order to install gtk+3.0.

I've read:

This is the package I'm trying to install through apt https://launchpad.net/ubuntu/+source/gtk+3.0/3.24.18-1ubuntu1

What is the correct way to enable it via source.list and such that I could do sudo apt install gtk+3.0? Or is the correct way just to manually install it by downloading the .deb file??

I have not try to use synaptic yet, I'd like to stay as vanilla as possible, should I be using synaptic?


Edit: The reason why I want to have the package is that I have source code that looks for gtk/gtk.h which depends on that gtk+-3.0 package.

fatal error: gtk/gtk.h: No such file or directory
   33 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~
  • Why are you trying to install this package specifically? Jan 30 at 16:22
  • I am trying to compile some of my code and is looking for gtk/gtk.h which is from gtk+3.0. I was able to accomplish this in 22.04 which had the package directly off apt but not with 20.22. Jan 30 at 18:37
  • 1
    gtk+3.0 would be the source package for binary package libgtk-3-0 and development package libgtk-3-dev. The -dev package is what you need for the header files. I'm seeing version 3.24.18-1ubuntu1 from focal main and version 3.24.20-0ubuntu1.1 from focal-updates main (20.04.5) - not sure what you mean by 20.22? Jan 30 at 18:48

1 Answer 1


Ubuntu hosts packages in Launchpad, but you don't need to download them from Launchpad. The same packages are available from the official repositories via APT.

To find out the package you need, go to https://packages.ubuntu.com, and search for the library name (here, gtk.h) in the contents of the packages. You can choose the version of Ubuntu (20.04 is focal).

enter image description here

The results are the following.

enter image description here

As you can see, the related packages are libgtk-2.0-dev, libgtk-3-dev, 4-cran-rgtk2. Since you need gtk-3, install the related package with

sudo apt install libgtk-3-dev
  • Thanks for your answer, which helped me troubleshoot and figure out what was my problem. I've actually already installed those other packages: libgtk-3-dev libgcr-3-dev libdbus-glib-1-dev but it won't find it. It turns out the, when my Makefile never had the proper pkg-config call execute correctly. After some tinkering, I found where the gtk+-3.0.pc located and prefixed the PKG_CONFIG_PATH before calling x86_64-w64-mingw32-pkg-config. It then finally generated the correct --cflags and was able to find the gtk.h. Jan 30 at 21:50

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.