How To Update R To Latest Version
4 Answers 4
You lot demand to add R'south repository to your system:
-
Use your favorite text editor (I'm using
gedit
as an example) to open up/etc/apt/sources.list
:sudo -H gedit /etc/apt/sources.list
-
Add together this line to the file (if this is slow, use another mirror. You may also want to change
precise
into the codename for your Ubuntu version --- east.yard.,trusty
for 14.04):deb http://cran.rstudio.com/bin/linux/ubuntu precise/
-
Update the listing of packages
sudo apt-go update
-
Install the latest R-base of operations (you can also utilise the software center again):
sudo apt-become install r-base of operations
muru
181k 46 aureate badges 438 silvery badges 671 bronze badges
answered Mar eight, 2014 at 17:20
terdonterdon
91.8k 15 gold badges 184 silverish badges 283 bronze badges
8
Having had to spend time figuring this out and forgetting how it works, and then having to figure it out once again multiple times, here'south a more than complete answer that is future-proof.
-
Edit the
sources.list
file. This file contains the servers thatapt-get
consults to check whether software exists and where it can be downloaded from. I can edit the file using the following control:sudo -H gedit /etc/apt/sources.list
This requires the gedit editor. If you become an error, either install this (
sudo apt-get install gedit
) or use another editor like nano (sudo nano /etc/apt/sources.list
). -
Find a working server to download R from that besides has the version of R you are interested in. This often means that one has to expect for the proper noun of the latest Ubuntu release. A list of releases is maintained on the Ubuntu website. Expect for the latest released version and use simply the starting time word in its name without capitalization. For instance, for the xvi.04 release, the total name is
Xenial Xerus
and the proper name to employ is thusxenial
. Thus, we add the following line to thesources.list
:deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
Note that the higher up line uses the rstudio.com mirror. 1 can choose some other mirror from this long listing and accordingly modify the URL. For example:
deb http://mirrors.dotsrc.org/cran/bin/linux/ubuntu xenial/
-
Save and shut the file. Later this, one can install the newest version using:
sudo apt-get update # update apt-become's listing of known releases sudo apt-get install r-base # install the newest bachelor version of R
muru
181k 46 gold badges 438 silverish badges 671 statuary badges
answered Aug 25, 2016 at 13:36
CoderGuy123CoderGuy123
345 1 gilded badge 2 silver badges xi statuary badges
The answers so far are useful but they all omit the next step which is pretty much going to be required of anyone who intends to utilise R seriously. Quoted lines are from the canonical R Installation and Administration Manual:
Users who need to compile R packages from source [eastward.chiliad. package maintainers, or anyone installing packages with install.packages()] should also install the r-base of operations-dev packet:
sudo apt-go install r-base-dev
I call back potential installers should exist reading that Manual more advisedly than the recommendations on this page accept so far brash.
answered Nov 1, 2018 at four:09
For Ubuntu xiv.04 LTS the commands are
sudo -H gedit /etc/apt/sources.listing deb http://cran.rstudio.com/bin/linux/ubuntu quantal/
*Notation: the forward slash is required otherwise y'all get an error
sudo apt-go update sudo apt-go install r-base
muru
181k 46 golden badges 438 silvery badges 671 bronze badges
answered November 25, 2014 at four:xix
ArthurArthur
119 2 bronze badges
3
-
Hither's an Ansible job that can be used to accomplish this same task: - proper noun: Add CRAN repository to APT repository list apt_repository: repo='deb cran.rstudio.com/bin/linux/ubuntu quantal/' state=present
Dec 27, 2015 at five:38
Not the answer you're looking for? Scan other questions tagged software-installation r or ask your own question.
Source: https://askubuntu.com/questions/431380/how-do-i-install-upgrade-r-base-to-the-latest-version
Posted by: rugglesscuman.blogspot.com
Are at that place any changes in the second command for ubuntu 14.04 users?
Nov 14, 2014 at v:48
@VineetKaushik yes, change
precise
toquantal
.November 14, 2014 at nine:51
@terdon Yous need a trailing slash afterward precise in pace 2, as
precise/
. I know it'due south a bit dissimilar than most apt repositories, but that's how the instructions at cran.rstudio.com/bin/linux/ubuntu spell information technology out.Dec eighteen, 2014 at xvi:31
@DanielKessler does the slash brand whatever differenece? Abaft slashes are usually optional and tin be left out. The version proper name is just a directory in the repository then information technology really shouldn't make any difference.
Dec 19, 2014 at vii:31