Amazon EC2: Upgrading R

June 19, 2015

(This article was first published on Exegetic Analytics » R, and kindly contributed to R-bloggers)

After installing R and Shiny on my EC2 instance I discovered that the default version of R was a little dated and I wanted to update to R 3.2.0. It’s not terribly complicated, but here are the steps I took.

First, become root.

$ sudo /bin/bash

Remove the old version of R.

# apt-get remove r-base-core

Edit /etc/apt/sources.list and add the following:

deb trusty/

Back in the shell, add the public keys.

# gpg --keyserver --recv-key E084DAB9
# gpg -a --export E084DAB9 | apt-key add -

Update the package list and install the new base R package.

# apt-get update
# apt-get upgrade
# apt-get install r-base

When you launch R you should find that it is the sparkling new version.

Now you will want to update all of the packages too, so launch R (as root) and then do:

> update.packages(lib.loc = "/usr/local/lib/R/site-library", ask = FALSE)

If you have packages installed in a user library, you should update those too.

Finally, if you run into memory problems with the package updates, then you’ll need to add a swap file.

The post Amazon EC2: Upgrading R appeared first on Exegetic Analytics.

To leave a comment for the author, please follow the link and comment on their blog: Exegetic Analytics » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)