How-to install R on 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:

name=R project for Statistical Computing repository

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!!

22 thoughts on “How-to install R on CentOS

  1. 😀
    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.



  3. 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


    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 …


  4. 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


  5. 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


  6. 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: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.