-
-
Save abelsonlive/3834189 to your computer and use it in GitHub Desktop.
r init file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# run chmod +x THIS_GIST.sh | |
# configure for debian or ubuntu! debian has dependencies that ubuntu's libs will conflict with | |
# sources: | |
# http://cran.r-project.org/bin/linux/debian/ | |
# http://cran.r-project.org/bin/linux/ubuntu/README | |
# http://stackoverflow.com/questions/10255082/installing-r-from-cran-ubuntu-repository-no-public-key-error | |
clear | |
echo "Which OS are you on?" | |
echo "[d]ebian" | |
echo "[u]buntu" | |
read os | |
case "$os" in | |
"d" ) | |
## DEBIAN | |
## add key to apt | |
gpg --keyserver subkeys.pgp.net --recv-key 381BA480 | |
gpg -a --export 381BA480 > jranke_cran.asc | |
sudo apt-key add jranke_cran.asc | |
rm jranke_cran.asc | |
## add repos to apt | |
echo "deb http://cran.cnr.Berkeley.edu/bin/linux/debian squeeze-cran/" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://cran.cnr.Berkeley.edu/bin/linux/debian squeeze-cran/" | sudo tee -a /etc/apt/sources.list | |
;; | |
"u" ) | |
#UBUNTU | |
gpg --keyserver subkeys.pgp.net --recv-key E084DAB9 | |
gpg -a --export E084DAB9 > rutter.asc | |
sudo apt-key add rutter.asc | |
rm rutter.asc | |
echo "deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu lucid/" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://cran.cnr.Berkeley.edu/bin/linux/ubuntu lucid/" | sudo tee -a /etc/apt/sources.list | |
echo "deb http://launchpad.net/ubuntu precise-backports main restricted universe" | sudo tee -a | |
echo "deb http://packages.ubuntu.com/lucid" | sudo tee -a | |
;; | |
esac | |
## INSTALL RSTUDIO | |
sudo wget http://download2.rstudio.org/rstudio-server-0.96.331-i386.deb | |
sudo dpkg -i rstudio-server-0.96.331-i386.deb | |
sudo apt-get -f install | |
## INSTALL DEPENDENCIES | |
sudo apt-get install libxml2-dev | |
sudo apt-get install libcurl3-dev | |
sudo apt-get install liblzma2 | |
sudo apt-get install r-recommended | |
## UPDATE / UPGRADE | |
sudo apt-get update | |
sudo apt-get upgrade | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment