1

我正在尝试在 Ubuntu 上安装 R 4.0,但出现此错误:

$ sudo 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-base-core (>= 4.0.0-1.2004.0) but it is not going to be installed
          Depends: r-recommended (= 4.0.0-1.2004.0) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

按照https://cran.r-project.org/bin/linux/ubuntu/README.html的建议,我已经运行了这些命令来设置 apt 以接收 R 4.0 :

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
    sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
    sudo apt-get update

我做错了什么,我该如何解决?

我之前确实在这个系统上安装了 R 3.4,并用

sudo apt-get remove r-*
sudo apt-get purge r-*

我这样做是不是把事情搞砸了?

4

1 回答 1

1

事实证明,这个错误完全是我的:

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

添加了 Ubuntu 20.04 的存储库。我需要:

    sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
于 2020-05-26T11:09:30.030 回答