Upgrade R and RStudio
Post date: Jan 6, 2014 11:23:00 PM
In this post I share my experience on upgrading R version and upgrading RStudio version on Ubuntu 12.04.
Upgrading R and upgrading RStudio are two independent process. You can upgrade R version without upgrading RStudio by first upgrading R, then restart RStudio, and the program is smart enough to point to the right location of the upgraded R version.
R Installation
In my situation, I'm using R 3.0.1 and I want to upgrade to 3.0.2, and I'm behind the firewall of a company. I found the help page from CRAN most useful and it works for me.
First of all, I type the following command in the terminal
sudo gedit /etc/apt/sources.list
and I appended the following lines to the sources.list
# Bot edit
deb http://cran.fhcrc.org/bin/linux/ubuntu/ precise/
Note that I like Fred Hutchinson mirror, so I use the URL:
cran.fhcrc.org
You can always pick your favorite mirror from mirror links.
Next, you will need to do something about secure APT, and there are some difficulties if you are behind a firewall. I have tried many options from the help page, but the one that works for me starts from the line...
------
Some people have reported difficulties using this approach. The issue is usually related to a firewall blocking port 11371. If the first gpg command fails, you may want to try (thanks to Mischan Toosarani for the tip):
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
and then feed it to apt-key with
gpg -a --export E084DAB9 | sudo apt-key add -
------
Next, I just follow the instruction on the page:
sudo apt-get update sudo apt-get install r-base
and now it works without error messages. I then open the RStudio and found the R version is updated already.
Upgrade RStudio
First go to RStudio download page and select the .deb file appropriate to your system. Mine is
RStudio 0.98.490 - Debian 6+/Ubuntu 10.04+ (64-bit)
Download the .deb file. I store the downloaded file in ~/Downloads directory. I found the instruction on this page very helpful.
First I install the package gdepi which facilitates convenient installation of .deb file. Just type the command in the terminal:
sudo apt-get install gdebi-core
Next, you can install the .dep page using command:
sudo gdebi <name of downloaded rstudio file ending in .deb>
in my case, it is
sudo gdebi rstudio-0.98.490-amd64.deb
Now you can restart/open your RStudio and find it's upgraded already.