Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find out which version of GTK+ is installed on Ubuntu?

I need to determine which version of GTK+ is installed on Ubuntu

Man does not seem to help

like image 521
Craig Angus Avatar asked Sep 24 '08 09:09

Craig Angus


People also ask

What is GTK in Ubuntu?

GTK is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK is suitable for projects ranging from small one-off tools to complete application suites. . This package contains the example files and a demonstration program for GTK3.

How do I get GTK on Linux?

In order to install GTK for GNU/Linux and Unix systems, you will need to get the GLib, GObject-Introspection, Pango, Gdk-Pixbuf, ATK and GTK packages to build GTK. To read more about these packages, please refer to the Architecture.

What is the difference between GTK and GTK+?

GTK/GTK+ and GTK2 are different versions of the same API. GTK is an old, deprecated version, GTK2 is the previous one, GTK+ 3/GTK3 is the current version. GTK+ is the correct name of the old API, but most people just call it GTK. The C++ bindings for GTK+ are part of the project GTKmm.

Is GNOME GTK based?

GTK is at the heart of the GNOME application and software development kit. GTK is used to create graphical user interfaces (GUIs) for desktop environments, applications, and window managers.


2 Answers

This suggestion will tell you which minor version of 2.0 is installed. Different major versions will have different package names because they can co-exist on the system (in order to support applications built with older versions).

Even for development files, which normally would only let you have one version on the system, you can have a version of gtk 1.x and a version of gtk 2.0 on the same system (the include files are in directories called gtk-1.2 or gtk-2.0).

So in short there isn't a simple answer to "what version of GTK is on the system". But...

Try something like:

dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]' 

to list all the libgtk packages, including -dev ones, that are on your system. dpkg -l will list all the packages that dpkg knows about, including ones that aren't currently installed, so I've used grep to list only ones that are installed (line starts with i).

Alternatively, and probably better if it's the version of the headers etc that you're interested in, use pkg-config:

pkg-config --modversion gtk+ 

will tell you what version of GTK 1.x development files are installed, and

pkg-config --modversion gtk+-2.0 

will tell you what version of GTK 2.0. The old 1.x version also has its own gtk-config program that does the same thing. Similarly, for GTK+ 3:

pkg-config --modversion gtk+-3.0 
like image 134
Mark Baker Avatar answered Sep 29 '22 07:09

Mark Baker


get GTK3 version:

dpkg -s libgtk-3-0|grep '^Version' 

or just version number

dpkg -s libgtk-3-0|grep '^Version' | cut -d' ' -f2- 
like image 20
Dr Casper Black Avatar answered Sep 29 '22 08:09

Dr Casper Black