Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
r init file
#/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
;;
esac
#################
sudo apt-get update
sudo apt-get install r-base r-base-dev
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.