简体   繁体   English

在Ubuntu Xenial中升级R

[英]Upgrade R in Ubuntu xenial

I am trying to update R in my Ubuntu Xenial machine. 我正在尝试在Ubuntu Xenial机器上更新R。 When I run: 当我跑步时:

R --version 

the output is 输出是

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"

I have been checking a lot of post about how to do it. 我已经检查了很多有关如何做的帖子。 My main steps have been: 我的主要步骤是:

Open the source list and add the link 打开源列表并添加链接

sudo nano /etc/apt/sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/

(Maybe I am adding the link in the wrong place of the source.list? I don't know, I am new in Ubuntu). (也许我将链接添加到了source.list的错误位置?我不知道,我是Ubuntu中的新手)。 After adding the link, I save and exit the source.list. 添加链接后,我保存并退出source.list。 Then my steps have been: 然后我的步骤是:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base

Once the process is finished, I run again: 该过程完成后,我再次运行:

R --version

And the output is still 而且输出仍然

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"

I don't have a lot of experience with Linux yet but based on previous post and their solutions I cannot manage to solve the problem. 我还没有Linux的丰富经验,但是基于以前的文章及其解决方案,我无法解决问题。

By the way, I need to update R since some of the packages I need to use (such as rgdal) are not available under the version I currently have 顺便说一句,我需要更新R,因为我需要使用的某些软件包(例如rgdal)在我当前拥有的版本下不可用

Thanks for the help 谢谢您的帮助

M 中号

See this , as you are already doing you have to use the distribution from CRAN: 看到这个 ,因为您已经在做,您必须使用CRAN的发行版:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'

sudo apt-get update

sudo apt-get install r-base

The CRAN README probably is the right place to read first. CRAN自述文件可能是首先阅读的正确位置。

What you have it pretty good. 你有什么很好。 I would make it 我会做到的

a) use a file, say cran.list inside of /etc/apt/sources.list.d/ a)使用文件,例如/etc/apt/sources.list.d/ cran.list

b) use https:// , ie I have deb https://cloud.r-project.org/bin/linux/ubuntu zesty/ (and that actually points to the same CDN servers as what you have) b)使用https:// ,即我拥有deb https://cloud.r-project.org/bin/linux/ubuntu zesty/ (并且实际上指向的CDN服务器与您拥有的CDN服务器相同)

c) run apt-get update and then check via apt-cache policy r-base-core c)运行apt-get update ,然后通过apt-cache policy r-base-core检查apt-cache policy r-base-core

It should show both the newer (at CRAN) and older (from Ubuntu): 它应该显示较新的(在CRAN上)和较旧的(在Ubuntu上):

edd@bud:~$ apt-cache policy r-base-core
r-base-core:
  Installed: 3.4.3-1zesty0
  Candidate: 3.4.3-1zesty0
  Version table:
 *** 3.4.3-1zesty0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
        100 /var/lib/dpkg/status
     3.4.2-2zesty 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
     3.4.2-1zesty1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
     3.4.1-2zesty0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
     3.4.1-1zesty0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
     3.4.0-1zesty 500
        500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
     3.3.2-1 500
        500 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 Packages
edd@bud:~$

The three stars show that that is the installed version. 三颗星表明这是已安装的版本。

d) Now when you see the desired version available, install the usual way via apt-get install r-base-core . d)现在,当您看到所需的可用版本时,请通过apt-get install r-base-core安装常规方法。 You should get the highest version as expected. 您应该获得预期的最高版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Ubuntu 16.04 (Xenial) 上安装 R 包“devtools”时出现问题 - Problems installing R package "devtools" on Ubuntu 16.04 (Xenial) 我应该使用哪个版本的R来升级ubuntu 15.04中的R - What version of R should I use to upgrade R in ubuntu 15.04 使用 Rcpp 在 Ubuntu Xenial 上抛出 std::runtime_error 时出现段错误 - Segfault when throwing std::runtime_error on Ubuntu Xenial with Rcpp 使用终端在ubuntu 12.10服务器上升级r和rstudio - upgrade r and rstudio on ubuntu 12.10 server using terminal Ubuntu升级后在R应用程序中检测到堆栈崩溃 - stack smashing detected in R application after Ubuntu upgrade 在Ubuntu中升级到R 3.4.0和最新的rstudio后,rstudio崩溃并显示“ r错误4” - After upgrade in Ubuntu to R 3.4.0 and newest rstudio, rstudio crashes with, “r error 4” 在R升级期间,用户安装的R包在Ubuntu / Debian上会发生什么 - What happens on Ubuntu/Debian with user installed R packages during R upgrade 如何在 Ubuntu 中升级 IRKernel? - How to upgrade IRKernel in Ubuntu? 从Ubuntu上的Microsoft Machine Learning Server安装Microsoft R Open后,如何升级? - How do I upgrade Microsoft R Open when its installed from the Microsoft Machine Learning Server on Ubuntu? 如何在Linux中升级R? - How to upgrade R in linux?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM