Pratik Patil Pratik Patil - 3 months ago 26
R Question

Automated Installation of R-Studio Using Shell Script

Is there any way to automate the Installation Of R-Studio on Linux Systems? It should automatically detect operating system and install R and R-Studio with required dependencies.
Thanks..

Answer

I have prepared the following shell script to make this installation fully automated.

#!/bin/bash
# ******************************************
# Program: R-Studio Installation Script
# Developer: Pratik Patil
# Date: 16-04-2015
# Last Updated: 16-04-2015
# ********************************************

if [ "`lsb_release -is`" == "Ubuntu" ] || [ "`lsb_release -is`" == "Debian" ]
then
    sudo apt-get -y install r-base gdebi-core libapparmor1;
    sudo wget http://download2.rstudio.org/rstudio-server-0.98.1103-amd64.deb;
    sudo gdebi rstudio-server-0.98.1103-amd64.deb;

elif [ "`lsb_release -is`" == "CentOS" ] || [ "`lsb_release -is`" == "RedHat" ]
then
    sudo yum -y install R openssl098e;
    sudo wget http://download2.rstudio.org/rstudio-server-0.98.1103-x86_64.rpm;
    sudo yum -y install --nogpgcheck rstudio-server-0.98.1103-x86_64.rpm;
else
    echo "Unsupported Operating System";
fi

sudo rm -f rstudio-server-*;
sudo rstudio-server verify-installation;

How to Launch R-Studio in Ubuntu or Debian Systems? Enter the following command on the terminal:

rstudio;

How to Launch R-Studio in CentOS or RedHat Systems? Open the Following URL in browser:

http://localhost:8787

After that Login prompt will appear & then Login with the current system user credentials.