How to update R on ubuntu
0
0
Entering edit mode
7 months ago
Bosberg ▴ 50

I'm trying to update to the latest version of R on Ubuntu with the following command:

$sudo apt-get -y install r-base
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
r-base is already the newest version (4.4.0-1.2004.0).
The following packages were automatically installed and are no longer required:
...

I've done this many times and it always says that I should already be at version 4.4, but when I check what version is actually running I see this:

$R --version
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

i.e. an older version from 2022 (that is incompatible with some newer software that I need to install). To see which one is running I used the following:

$which R
/usr/local/bin/R

I guess apt is installing somewhere else? I don't know how to check where it's going. Any idea how I should properly update my version of R?

installation update R apt-get • 1.6k views
ADD COMMENT
0
Entering edit mode

You can check where the application was installed using: https://unix.stackexchange.com/questions/39590/apt-get-install-where-does-it-go

Then amend your $PATH to point to the R version you want to use.

ADD REPLY
0
Entering edit mode

Thanks for the suggestion, but I get several lines of results (see below) and although there are directories called "R", I can't find any executable R:

 $dpkg -L r-base 
 /. 
 /usr 
 /usr/share 
 /usr/share/doc
 /usr/share/doc/r-base /usr/share/doc/r-base/README.Debian
 /usr/share/doc/r-base/changelog.Debian.gz
 /usr/share/doc/r-base/copyright
ADD REPLY

Login before adding your answer.

Traffic: 2381 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6