Created
October 4, 2012 14:55
-
-
Save seeRead/3834078 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 | |
;; | |
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