Tuesday 4 July 2017

R Installation in Centos/RHEL-7 with R-Studio

R installation on CentOS/RHEL - 7 with R-Studio

Step 1: Make local repository 

First we need to mount the iso image into /mnt/cdrom directory.

[root@master ~]#  mount -t iso9660 /dev/cdrom /mnt/cdrom

[root@master ~]# vim /etc/yum.repo.d/centos.repo
[centos]
name=CentOS
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0

Save it  with [esc]:wq!

Step 2: Download and Configure epel-release rpm

[root@master ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@master ~]# yum localinstall epel-release-*
[root@master ~]# yum clean all
[root@master ~]# yum repolist

Step 3: Manually download Dependencies Packages( If you installing R, without installing the dependencies manually then it's occurs dependencies error, so it better download one-by-one and install it.)

[root@master ~]# wget ftp://195.220.108.108/linux/epel/7/x86_64/r/R-java-3.4.0-2.el7.x86_64.rpm
[root@master ~]# yum localinstall R-java-*
[root@master ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/blas-devel-3.4.2-5.el7.x86_64.rpm
[root@master ~]# yum localinstall blas-devel-3.4.2-5.el7.x86_64.rpm
[root@master ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/lapack-devel-3.4.2-5.el7.x86_64.rpm
[root@master ~]# yum localinstall lapack-devel-3.4.2-5.el7.x86_64.rpm
[root@master ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/texinfo-tex-5.1-4.el7.x86_64.rpm
[root@master ~]# yum localinstall texinfo-tex-5.1-4.el7.x86_64.rpm
[root@master ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/texlive-epsf-svn21461.2.7.4-38.el7.noarch.rpm
[root@master ~]# yum localinstall texlive-epsf-svn21461.2.7.4-38.el7.noarch.rpm

[root@master ~]# yum clean all
[root@master ~]# yum repolist
[root@master ~]# yum update; init 6

Step 4: Disable selinux
[root@master ~]# setenforce 0

Step 5: Disable Firewall
[root@master ~]# systemctl stop firewalld.service
[root@master ~]# systemctl disable firewalld.service


Step 6: Now, Install R
[root@master ~]# yum install R

Step 7: Download R-Studio Server 
[root@master ~]# wget https://download2.rstudio.org/rstudio-server-rhel-1.0.143-x86_64.rpm
[root@master ~]# yum localinstall --nogpgcheck rstudio-server-rhel-1.0.143-x86_64.rpm
[root@master ~]# service rstudio-server status/start/stop/

Step 8: Check R in shell prompt: type R

[root@master ~]# R
R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>
> version
               _
platform       x86_64-redhat-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          3
minor          4.0
year           2017
month          04
day            21
svn rev        72570
language       R
version.string R version 3.4.0 (2017-04-21)
nickname       You Stupid Darkness


All done... Happy Learning R