How-to install R on CentOS

CentOS

CentOS, logo A not so christmas-connected topid today as I’m going to write down a few lines on how-to install the open source statistical tool and relative developement libraries R on CentOS release 4 and 5.

Personally I’ve tried it successfully on CentOS 5.

CentOS today does not provide any build of this tool in it’s official and semi-official repositories but, luckily the R-project itselfs provides the binaries for the most common GNU/Linux distributions (and for Windows or Mac OS X, alongside with the sources) on it’s mirror network.

There you can find binary rpms and also yum metadata, so you can create a .repo file for and organic and integrated use of those inside the YUM package manager.

So here’s the R.repo file I’ve created for myself:

[R-project]
name=R project for Statistical Computing repository
baseurl=http://rm.mirror.garr.it/mirrors/CRAN/bin/linux/redhat/el5/i386
failovermethod=priority
enabled=1
gpgcheck=0
priority=15

Maybe it’s necessary a quick note on gpgcheck=0 since I was not able to find the GPG key of the rpms (maybe they’re not available ???) and on priority=15 since i use yum-priorities to protect the official core of the distro.

If you have suggestions or enhancements to propose the comments are always open!!

About these ads

22 thoughts on “How-to install R on CentOS

  1. :-D
    glad you liked it …

    probably if you do a lot of searches in yum for repo list you may need to modify

    [R - Project for Statistical Computing]

    into something shorter and without spaces …

  2. Hello. I use the GPG key below for my R.repo file.

    gpgkey=http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x99B62126

  3. Hello,

    I added this repo and i installed R. But i can not run in graphical mode, how can i do it

    Thank you

  4. Hello,
    I’ve installed for Centos 5.3, and it seems to work well:
    But the R.repo file to create in /etc/yum.repo.d/ should be something like the following (I think the format is slightly important !!).
    Also notice that the key provided by Steve did not work for me.

    #R-Statistical Computing
    [R]
    name=R-Statistics
    baseurl=http://rm.mirror.garr.it/mirrors/CRAN/bin/linux/redhat/el5/i386
    failovermethod=priority
    enabled=1
    gpgcheck=0
    priority=15

    1. Uhm … Mongo, in the end I believe that what’s between the [] is what you want to see in situations like a yum check-update or similar …

      In my case doing the previous command I see:

      R-project | 1.0 kB 00:00
      primary.xml.gz | 2.8 kB 00:00
      R-project 5/5

      Also I do not use a key to authenticate the provided packages.

      As a last note I have to say that on a RHEL I’m using EPEL ad my R software repo without problems.

      Probably I will do the same on the CentOS boxes in the near future …

  5. Uhm… I want to install R to my server, which I only can access through ssh. I personally use Ubuntu but server is centOS, which I’m not familiar at all, so I really didn’t get that R.repo thing :(.

    What excactly should I do to install R? Is R.repo a text file in /etc/yum.repo.d/?

    Any help is appreciated, thanks… -jan

  6. Hi

    only wanted to ask if i could use your Ascii Xmas Tree for our Invitation to a NerdMas Party in Munich? Maybe if you add a cc-deed or bysa License to it? :) Would be great. Great blog by the Way

  7. This was sooo helpful. I was required to install R for my application support group and very little info on it for Red Hat or Centos for that matter. Once I download the EPEL and installed it. Then I ran the yum install R and it worked like a charm.

    Many thanks!

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