Install R

In order to get R running on RHEL 6, we need to add an additional repository that allows us to install the new packages. The EPEL (Extra Packages for Enterprise Linux) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL).

EPEL Repository

First, login as root user, and add EPEL repository:

You can also search for additional R packages using yum command:

yum list R-\*

When the installation is finished successfully, you can run R:

# In the R console, type 'q()' to exit

To verify is EPEL repository is enabled, run following command:

yum repolist

And the output could be like:

repo id                                                                   repo name                                                                                     status
*epel                                                                     Extra Packages for Enterprise Linux 6 - x86_64                                                11,992
mirror.centos.org_centos_6_os_x86_64_                                     added from:                                       6,575
rpmforge                                                                  RHEL 6Server - - dag                                                              4,718
repolist: 23,285

[Optional] CentOS Repository

Sometimes, there could be some library missing while installing R using yum. In this case, you may need add CentOS repository by creating a new repository file:

vi /etc/yum.repos.d/centos.repo

And add following contents (note that you need to change the version number depending on your RHEL version):

# Repoitory

Install Rserve Package

Download and Install

Find the Rserve package file in our R archive, or download the latest version from CRAN.

Then use R CMD to install the package (the file name could be different):

R CMD INSTALL Rserve_1.8-3.tar.gz


Rserve is configured by the configuration file /etc/Rserv.conf. If no configuration file is supplied, Rserve accepts no remote connections, requires no authentication and file transfer is enabled. To enable remote access, we need to create a configuration file and enable remote:

echo "remote enable" > /etc/Rserv.conf

The other possible configuration items are as follows (all entries are optional, default values are in angled brackets):

workdir <path> [/tmp/Rserv]
pwdfile <file> [none=disabled]
remote enable|disable [disable]
auth required|disable [disable]
plaintext enable|disable [disable]
fileio enable|disable [enable]
interactive yes|no [yes] (since 0.6-2)

(since version 0.1-9):
socket <socket> [none=disabled]
port <port> [6311]
maxinbuf <size in kb> [262144]

(since version 0.3):
maxsendbuf <size in kb> [0=unlimited]
uid <uid> [none]
gid <gid> [none]
su now|server|client [none] (since 0.6-1)

(since version 0.3-16):
source <file>
eval <expressions>

(since version 0.5 and unix only):
chroot <directory> [none]
sockmod <mode> [0=default]
umask <mask> [0]

(since version 0.5-3):
encoding native|utf8|latin1 [native]
(since version 0.6-2):

Start Rserve

Login as rudolph user and start the Rserve by:

R CMD Rserve

Then check if the Rserve can be remotely accessed from other machine:

telnet <host> <port(6311)>

If you have an accessible Rserve, you should see a response like:

Trying x.x.x.x...
Connected to x.x.x.x.
Escape character is '^]'.

Install ROracle Package

Find the R package files (DBI and ROracle) in our R archive, or download the latest version from DBI and ROracle.

Install DBI

R CMD INSTALL DBI_0.3.1.tar.gz

Install ROracle

If you have Oracle Client installed, you need to set LD_LIBRARY_PATH and ORACLE_HOME variables. For example, if the Oracle was installed in /apps/oracle/product/11g, then you need to do following:

# Set variables
export ORACLE_HOME=/apps/oracle/product/11g/:$ORACLE_HOME
export LD_LIBRARY_PATH=/apps/oracle/product/11g/lib/:$LD_LIBRARY_PATH

# Install pacakge
R CMD INSTALL ROracle_1.2-1.tar.gz

If you have Oracle Instant Client installed, you need to set OCI_LIB and LD_LIBRARY_PATH variables. For example, if the Instant Client was installed in /apps/oracle/instantclient_11_2, then you need to do following:

# Set variables
export OCI_LIB=/apps/oracle/instantclient_11_2/
export LD_LIBRARY_PATH=/apps/oracle/instantclient_11_2/:$LD_LIBRARY_PATH

# Install pacakge
R CMD INSTALL ROracle_1.2-1.tar.gz

To verify if ROracle is installed, you can launch R console by running R and load the library:


For more details about installing ROracle, please refer to

Uninstall R

Suppose you install R using yum, then you can use the following commands to totally uninstall R:

yum remove R
yum remove R-core
yum remove R-devel
yum remove R-core-devel

Reference & Resource