Install R and Rstudio in Ubuntu 16.04 LTS !

R is a programming language and free software environment for statistical computing and graphics that is supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis.
R is hot. Whether measured by more than 10,000 add-on packages, the 95,000+ members of LinkedIn’s R group or the more than 400 R Meetup groups currently in existence, there can be little doubt that interest in the R statistics language, especially for data analysis, is soaring.

Why R? It’s free, open source, powerful and highly extensible. “You have a lot of prepackaged stuff that’s already available, so you’re standing on the shoulders of giants,” Google’s chief economist told The New York Times back in 2009.

Note:- You can find the R-Base in the Ubuntu Software Center, but mostly they can be outdated. Now to make sure that you are on the most updated package repository, we need to add a repo. First, we’ve got to add a line to our /etc/apt/sources.list file.

Note the “xenial” in the line, indicates that it’s Ubuntu 16.04. If you have a different flavour or versions of it, just change that respectively.

sudo echo "deb xenial/" | sudo tee -a /etc/apt/sources.list

Add the Keyring.


gpg --keyserver --recv-key E084DAB9


gpg -a --export E084DAB9 | sudo apt-key add -

Install the R-Base

sudo apt-get update
sudo apt-get install r-base r-base-dev

Install the R Studio

sudo apt-get install gdebi-core
sudo gdebi -n rstudio-1.0.143-amd64.deb
rm rstudio-1.0.143-amd64.deb

That’s it.

Note:- In case you get stuck while executing the above commands one by one just run, this:-

CTRL+C to stop then

sudo apt-get clean

to clean your local repo and then try the command again

sudo apt-get install r-base r-base-dev

Image courtesy:-