Last active
May 26, 2016 23:41
-
-
Save walshc/28fb754ea9ff95fbae7c6f3b14ac15de to your computer and use it in GitHub Desktop.
Install latest R to ~/.local.
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 | |
R_VERSION="3.2.5" | |
wget https://cran.r-project.org/src/base/R-3/R-$R_VERSION.tar.gz | |
tar -xvf R-$R_VERSION.tar.gz | |
rm R-$R_VERSION.tar.gz | |
cd R-$R_VERSION | |
# If ~/.local/bin doesn't exist, create it: | |
if [ ! -d "$HOME/.local/bin" ]; then | |
mkdir -p $HOME/.local/bin | |
fi | |
./configure --prefix=$HOME/.local/ | |
make | |
make install | |
# If ~/.local/bin is not already in $PATH, add it: | |
if ! [[ ":$PATH" == *":$HOME/.local/bin:"* ]]; then | |
echo "Adding ~/.local/bin to PATH" | |
echo "export PATH="\$HOME/local/bin:\$PATH"" >> ~/.bashrc | |
source ~/.bashrc | |
fi | |
rm -r R-$R_VERSION | |
echo "Installation complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions
At the command line, enter:
curl https://gist.githubusercontent.com/walshc/28fb754ea9ff95fbae7c6f3b14ac15de/raw/cdca7b9894ef8c458a7fd00a4c83e1bd819d362a/installr.sh | sh