Update your local repository
deb <mirror>/bin/linux/ubuntu trusty/
save and close
Update your local repositories with added libraries
sudo apt-get update
sudo vi /etc/apt/sources.listCheck http://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
In the end of the file paste the below content
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/If your mirror is different from http://cran.rstudio.com then use
deb <mirror>/bin/linux/ubuntu trusty/
save and close
Update your local repositories with added libraries
sudo apt-get update*Install R base and dev libraries
sudo apt-get install r-base-dev r-base