How to get the GNOME version?

GNOME 3 version is stored in this file:

/usr/share/gnome/gnome-version.xml

content (on my system):

<?xml version="1.0" encoding="UTF-8"?>
<gnome-version>
 <platform>3</platform>
 <minor>6</minor>
 <micro>2</micro>
 <distributor>Arch Linux</distributor>
 <date>2012-11-13</date>
</gnome-version>

The file is part of the upstream package called gnome-desktop (note that some distros split it into several packages so on your distro the file may end up in a package with a different name...)

GNOME developers use this file to get the DE version number and display it in System Settings (aka gnome-control-center). So getting GNOME version "the official way" means parsing the said file and extracting platform, minor and micro values.

If you play with that file you can instantly see the results :)

enter image description here

In GNOME 2 the file in question is:

/usr/share/gnome-about/gnome-version.xml

(though this file might be missing on some older Gnome 2 versions IIRC)


And no, you shouldn't use commands like gnome-session --version, gnome-shell --version, gdm --version etc. Those are GNOME desktop components, they are separate packages (with different code, history/changelog and maintainers) and as such their version may be different. They'll report the right GNOME version only if they have the same version as gnome-desktop (which is not always the case).


If you launch gnome-system-monitor it shows the version in the dialog:

% gnome-system-monitor

My aging Fedora 14 box

            ss of monitor dialog fedora

Ubuntu 12.04

             ss of monitor dialog ubuntu


Try gnome-session --version. There is a man page for it on my Debian (namely GNOME-SESSION(1)) but the --version option is not listed. Well, for me it says gnome-session 3.4.2.1.

You can run it in the console

DISPLAY=":0" gnome-session --version

(possibly having to change the display).

Tags:

Gnome