I need to determine which version of GTK+ is installed on Ubuntu
Man does not seem to help
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
|
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:
to list all the libgtk packages, including -dev ones, that are on your system. Alternatively, and probably better if it's the version of the headers etc that you're interested in, use pkg-config:
will tell you what version of GTK 1.x development files are installed, and
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:
|
|||||||||||||||||
|
|
This will get the version of the GTK+ libraries for GTK+ 2 and GTK+ 3.
As major versions are parallel installable, you may have both on your system, which is my case, so the above command returns this on my Ubuntu Trusty system:
This means I have GTK+ 2.24.23 and 3.10.8 installed. If what you want is the version of the development files, use
|
|||
|
|
|
Try:
|
|||||
|
|
get GTK3 version:
or just version number
|
|||||
|
|
Try,
or,
|
||||
|
|
|
You could also just compile the following program and run it on your machine.
compile with ( assuming above source file is named version.c):
When you run this you will get some output. On my old embedded device I get the following:
|
|||||||||||||
|
|
To make the answer more general than Ubuntu (I have Redhat): gtk is usually installed under /usr, but possibly in other locations. This should be visible in environment variables. Check with
Then try to find where your gtk files are stored. For example, use
In this way, I found |
|||
|
|
|
You can also just open synaptic and search for libgtk, it will show you exactly which lib is installed. |
|||
|
|
|
I think a distribution-independent way is:
|
|||||
|
|
|||||
|