Installing RGtk2 on Red Hat Enterprise Linux

So after my nice secure installation of R in my environment, I found that my users couldn’t even accomplish the simple (and fundamental) task of installing the RGtk2 package.  The initial attempt met with:

* installing *source* package ‘RGtk2’ ... 
** package ‘RGtk2’ successfully unpacked and MD5 sums checked 
checking for pkg-config... /usr/bin/pkg-config 
checking pkg-config is at least version 0.9.0... yes 
checking for INTROSPECTION... no 
checking for GTK... no 
configure: error: GTK version 2.8.0 required 
ERROR: configuration failed for package ‘RGtk2’ 
* removing ‘/usr/lib64/R/library/RGtk2’

The natural thing for an administrator to do here would be to simply run yum list gtk.  Unfortunately, no such package exists.  So, you might execute yum list gtk\* (escape the asterisk so the shell doesn’t interpret it as a filename expansion) and see a whole slew of packages looking something like this (but with more aesthetically appealing spacing absent here due to the copy+paste operation from my console to my blog):

Installed Packages
gtk2.x86_64 2.20.1-4.el6 @rhel-x86_64-server-6
gtk2-engines.x86_64 2.18.4-5.el6 @rhel-x86_64-server-6
Available Packages
GtkAda.i686 2.14.1-8.el6.1 epel 
GtkAda.x86_64 2.14.1-8.el6.1 epel 
GtkAda-devel.i686 2.14.1-8.el6.1 epel 
GtkAda-devel.x86_64 2.14.1-8.el6.1 epel 
GtkAda-doc.noarch 2.14.1-8.el6.1 epel 
GtkAda-gl.i686 2.14.1-8.el6.1 epel 
GtkAda-gl.x86_64 2.14.1-8.el6.1 epel 
GtkAda-glade.i686 2.14.1-8.el6.1 epel 
GtkAda-glade.x86_64 2.14.1-8.el6.1 epel 
GtkAda-gnome.i686 2.14.1-8.el6.1 epel 
GtkAda-gnome.x86_64 2.14.1-8.el6.1 epel 
gtk+.i686 1:1.2.10-70.el6 epel 
gtk+.x86_64 1:1.2.10-70.el6 epel 
gtk+-devel.i686 1:1.2.10-70.el6 epel 
gtk+-devel.x86_64 1:1.2.10-70.el6 epel 
gtk+extra.x86_64 2.1.1-13.el6 rhel-x86_64-server-6 
gtk-aurora-engine.i686 1.5.1-7.el6 epel 
gtk-aurora-engine.x86_64 1.5.1-7.el6 epel 
gtk-chtheme.x86_64 0.3.1-11.el6 epel 
gtk-doc.noarch 1.11-5.1.el6 rhel-x86_64-server-6 
gtk-gnutella.x86_64 1.0.0-1.el6 epel 
gtk-murrine-engine.i686 0.98.2-1.el6 epel 
gtk-murrine-engine.x86_64 0.98.2-1.el6 epel 
gtk-recordmydesktop.noarch 0.3.8-6.el6 epel 
gtk-redshift.x86_64 1.6-3.el6 epel 
gtk-vnc.i686 0.3.10-3.el6 rhel-x86_64-server-6 
gtk-vnc.x86_64 0.3.10-3.el6 rhel-x86_64-server-6 
gtk-vnc-python.x86_64 0.3.10-3.el6 rhel-x86_64-server-6 
gtk-xfce-engine.i686 2.8.1-1.el6 epel 
gtk-xfce-engine.x86_64 2.8.1-1.el6 epel 
gtk2.i686 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2.x86_64 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2-devel.i686 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2-devel.x86_64 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2-devel-docs.x86_64 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2-engines.i686 2.18.4-5.el6 rhel-x86_64-server-6 
gtk2-immodule-xim.i686 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2-immodule-xim.x86_64 2.24.23-6.el6 rhel-x86_64-server-6 
gtk2hs-buildtools.x86_64 0.12.1-2.el6.2 epel 
gtkglarea2.i686 2.0.1-1.el6 epel 
gtkglarea2.x86_64 2.0.1-1.el6 epel 
gtkglarea2-devel.i686 2.0.1-1.el6 epel 
gtkglarea2-devel.x86_64 2.0.1-1.el6 epel 
gtkhtml2.i686 2.11.1-7.el6 rhel-x86_64-server-6 
gtkhtml2.x86_64 2.11.1-7.el6 rhel-x86_64-server-6 
gtkmm24.x86_64 2.18.2-1.el6 rhel-x86_64-server-6 
gtksourceview2.x86_64 2.8.2-4.el6 rhel-x86_64-server-6 
gtksourceviewmm.i686 2.2.0-4.el6 epel 
gtksourceviewmm.x86_64 2.2.0-4.el6 epel 
gtksourceviewmm-devel.i686 2.2.0-4.el6 epel 
gtksourceviewmm-devel.x86_64 2.2.0-4.el6 epel 
gtkspell.x86_64 2.0.16-1.el6 rhel-x86_64-server-6 
gtkterm.x86_64 0.99.5-11.el6 epel 
gtkwave.x86_64 3.3.25-1.el6 epel

So, in the Red Hat environment, the GIMP Toolkit (GTK+) software has been split into various packages.  There are gtk2 and gtk3 packages representing GTK+ major versions 2 and 3.  For Red Hat Enterprise Linux 6, support ends with the gtk2 package, meaning you won’t be getting the latest GTK+ software (3.1.2) from RHN.  However, we need only 2.8.0 according to the R output.  A brief examination of the output above reveals that we 2.20.1-4 installed (and in the GTK environment, 2.8.0 is below 2.20.1) and that number does, in fact, correspond correctly to the GTK software version.

So what’s the problem?  The problem is that we need to install gtk2-devel.  It’s that simple.  It’s not clear, but it’s a simple solution to a fundamental problem which has, again, surprisingly little in the way of Internet documentation.

sudo yum install gtk2-devel

Now just get back into the R shell and execute install.packages(“RGtk2”) and you will hopefully be observing a successful installation process!

Advertisements
This entry was posted in Information Technology and tagged , . Bookmark the permalink.

2 Responses to Installing RGtk2 on Red Hat Enterprise Linux

  1. Mark Thomas says:

    Thank you for posting this. I had a difficult time getting gtk installed on my RHEL 7. A weekend away from it and a fresh google search led me to your site. Thanks again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s