首页 > 解决方案 > 在 Ubuntu disco 19.04 上安装 R 3.6

问题描述

我有新的 Ubuntu disco 19.04,我按照这里的说明安装了新的 R 3.6。

但是,在安装密钥并通过以下方式添加存储库后:

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/'

并运行:

sudo apt update
sudo apt 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-base-core (>= 3.6.0-1cosmic) but 3.5.2-1build1 is to be installed
          Depends: r-recommended (= 3.6.0-1cosmic) but 3.5.2-1build1 is to be installed
E: Unable to correct problems, you have held broken packages.

我可以通过安装 R

sudo apt install r-base

在添加上述存储库之前,但3.5.2已安装版本。

有谁知道如何安装它而无需从源代码编译?

标签: r

解决方案


我遵循相同的说明,也获得了 R 3.5。在运行之前添加 repo 的 pubkeyapt update得到了 R 3.6。

这些应该是将 R 3.6 安装到新的 Ubuntu 19.04 中的步骤:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/'
sudo apt update
sudo apt install r-base-dev

更改存储库详细信息允许安装到其他 Ubuntu 版本,即在 Ubuntu 16.04 中将“disco”替换为“xenial”。

2020 年 10 月更新:同样(添加 repo、添加 repo 密钥、更新、安装),按照Sébastien Rochette在 thinkr.fr 上的本教程将Ubuntu 更新到 20.* 和 R 到 4.* 作为奖励,它来了带有空间包依赖项的安装提示。


推荐阅读