[英]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.