102

How can I install GTK+ 3.0 and use that instead of GTK+ 2.24?

3 Answers 3

266

To use gtk2 or gtk3 apps you don't need to install anything. But, if you want to develop (or even just compile) apps this is what you're looking for:

sudo apt-get install libgtk-3-dev
3
  • Is this true for Windows and MacOS as well (or just for Ubuntu or GNU/Linux?)
    – sunyata
    Oct 31, 2016 at 1:03
  • 10
    Just for Ubuntu.
    – Thomio
    Oct 31, 2016 at 13:33
  • 10
    this should be the preferred answer
    – Asalle
    May 22, 2019 at 7:21
27

GTK3 is installed by default, please don't download and compile from the GTK website.

If you want to use GTK3 yourself, compile against that instead GTK2, or use PyGObject instead of PyGTK if you're using Python.

If you want all programs to use GTK3 instead of GTK2, it won't work, it's a job for the application developers to port their application.

5
  • How can it be installed by default when i enter the command: dpkg -l libgtk[0-9]* | grep ^i and i get that im using GTK 2.24?
    – dlin
    Feb 4, 2012 at 11:33
  • 1
    The package name changed a bit, try this: dpkg -l libgtk-[0-9]* | grep ^i
    – Timo
    Feb 4, 2012 at 11:49
  • Also note that GTK2 and GTK3 are parellel installable. So it's not that you are using one or the other, it's the applications that choose which version.
    – Timo
    Feb 4, 2012 at 11:51
  • @Nick if you have questions about specific apps, it would be better to ask a new question. We wouldn't want useful information to get lost in the comments. :) Feb 5, 2012 at 0:24
  • Wasn't installed by default on my Ubuntu 20.04 LTS. Used below answer. Aug 20, 2020 at 16:24
2

If you already have an older version of GTK and you want to upgrade it then you can do the following:

sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt update
sudo apt dist-upgrade

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.