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



Planet SUSE
Red Hat People
WordPress.org





December 29, 2008 at 08:14
Thanks for the repo!
December 29, 2008 at 11:08
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 …
February 3, 2009 at 01:08
Hello. I use the GPG key below for my R.repo file.
gpgkey=http://pgp.mit.edu:11371/pks/lookup?op=get&search=0×99B62126
April 21, 2009 at 18:13
Hello,
I added this repo and i installed R. But i can not run in graphical mode, how can i do it
Thank you
September 24, 2009 at 11:43
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
September 25, 2009 at 22:39
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 …
October 6, 2009 at 04:12
note that in the .repo file, if you change /i386 to /x86_64 , you can download the 64 bit version.
October 30, 2009 at 01:54
Great tip, I was having trouble installing R on FC10.
This sorted everything for me.
Thx.,
J
November 18, 2009 at 15:50
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
November 18, 2009 at 17:26
Jan, get a grip with EPEL repository: http://fedoraproject.org/wiki/EPEL
They too provide the R family packages and are used as a “base” for other projects.
November 22, 2009 at 14:20
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
November 22, 2009 at 17:48
Hi!
Of course you can … enjoy and drink a beer for me too
November 23, 2009 at 11:04
Great, thx a lot