Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know where to put this line in the file. Or is there the possibility to achieve it over the shell somehow? I'm using 14.04.


To obtain the latest R packages, add an entry like

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/ or

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/ or

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu lucid/

in your /etc/apt/sources.list file, replacing <my.favorite.cran.mirror> by the actual URL of your favorite CRAN mirror. See for the list of CRAN mirrors. To install the complete R system, use

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

My mirror would be:

share|improve this question
Do you really need the latest version? Version 3.0.2 is available from the standard repository for Ubuntu Trusty (without adding anything to your sources.list file) just by typing sudo apt-get update && sudo apt-get install r-base – steeldriver Jul 27 '14 at 11:51
If one is doing anything bioconductor-related (which by now is a large portion of the R community), one must use the very latest stable R. – Gx1sptDTDa Jul 27 '14 at 11:54
up vote 8 down vote accepted

Add the following line to your /etc/apt/sources.list file. It doesn't matter where exactly, but end of the file is ok.

deb trusty/ #enabled-manually

If you insist on doing this in a terminal, do the following:

sudo su 
echo "deb trusty/ #enabled-manually" >> /etc/apt/sources.list

This will launch a super user session, and append the line to the sources.list file, after which we exit from the super user session.

Then, per the R installation instructions, one must add the public key of Michael Rutter to secure apt. Execute the following in a terminal:

sudo apt-key adv --keyserver --recv-keys E084DAB9

Then simply do sudo apt-get update && sudo apt-get install r-base r-base-dev.

Happy R-ing!

share|improve this answer
Thanks a lot. I hope I get a grip with it. – empedokles Jul 27 '14 at 12:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.