我在 Azure Linux 虚拟机上使用 Ubuntu 16.04
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
Rstudio/Rserver 当前的 R 版本是 3.4.4,我想将其更新到最新版本(即版本 3.5.2)
R --version
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
由于某些原因,最常见的方法不起作用:
apt-get update
apt-get upgrade
所以我做了一些研究并发现了这个 post在biostars.org上
其中一篇文章说以下代码可能有效
sudo su
echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
apt-get update
apt-get install r-base
apt-get install r-base-dev
但是,在 apt-get install r-base
之后,我收到以下错误消息:
root@VMforR:/usr/local/bin# apt-get install r-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 3.5.2-1xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我不明白“持有损坏的包”是什么意思,更重要的是,如何更新 R 库?
最佳答案
对我有用的是添加 Michael Rutter 的 PPA:
sudo add-apt-repository ppa:marutter/rrutter3.5
sudo apt-get update
更新R:
sudo apt install r-api-3.5
我使用的是 16.04 LTS ubuntu。
关于r - 将 R 基础 - Ubuntu 从 3.4.4 更新到 3.5.2 - Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54068089/