AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1376253
Accepted
littleworth
littleworth
Asked: 2021-11-18 22:49:21 +0800 CST2021-11-18 22:49:21 +0800 CST 2021-11-18 22:49:21 +0800 CST

当“r-base”没有安装候选时,如何在 Ubuntu 18.04 上安装 R 4.0

  • 772

我按照此说明在 Ubuntu 18.04 中安装 R 4.0

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

但是我收到此错误消息:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package r-base is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  r-base-core r-doc-info r-doc-html r-base-html r-base-core:i386

E: Package 'r-base' has no installation candidate

我正在使用这个版本的 Ubuntu:

$ uname -a
Linux ip-172-31-28-209 5.4.0-1059-aws #62~18.04.1-Ubuntu SMP Fri Oct 22 21:51:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -cs
bionic

我该如何解决这个问题?


更新

$ sudo apt-cache policy r-base
r-base:
  Installed: (none)
  Candidate: (none)
  Version table:
     4.1.2-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.1.1-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.1.0-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.5-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.4-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.3-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.2-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.1-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.0-1.1804.0 -1
         -1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     3.4.4-1ubuntu1 -1
         -1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

更新 2

$ sudo apt install r-base=4.1.2-1.1804.0
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.1.2-1.1804.0) but it is not installable
          Depends: r-recommended (= 4.1.2-1.1804.0) but it is not installable
          Recommends: r-base-html but it is not installable
          Recommends: r-doc-html but it is not installable
E: Unable to correct problems, you have held broken packages.
system-installation
  • 3 3 个回答
  • 1265 Views

3 个回答

  • Voted
  1. Best Answer
    littleworth
    2021-12-07T03:12:36+08:002021-12-07T03:12:36+08:00

    根据@user.dz 的建议,我最终手动编辑/etc/apt/preferences并将 pin 优先级从 -1 替换为 500

    Package: *
    Pin: release a=bionic*
    Pin-Priority: 500
    
    • 2
  2. abu-ahmed al-khatiri
    2021-12-07T03:37:01+08:002021-12-07T03:37:01+08:00

    问题是 :

    $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
      Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
      Executing: /tmp/apt-key-gpghome.D7jTjWc4gW/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
      gpg: key 51716619E084DAB9: "Michael Rutter <[email protected]>" 1 new signature
      gpg: Total number processed: 1
      gpg:         new signatures: 1     
    

    当您运行密钥服务器时,就像我的情况一样apt-key,不推荐使用。/tmp/CRAN 上的 Ubuntu 档案使用Michael Rutter [email protected]带有密钥 ID的密钥进行签名0x51716619e084dab9。要使用一个命令将密钥添加到系统,请使用

    推荐方法:

    $ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
    $ sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
    $ sudo apt update
    $ sudo apt install --no-install-recommends r-base     
    

    希望这可以帮助。

    有关的

    • https://cran.r-project.org/
    • https://cran.r-project.org/bin/linux/ubuntu/fullREADME.html
    • 1
  3. David
    2021-11-18T23:39:10+08:002021-11-18T23:39:10+08:00

    鉴于您收到以下消息:

    However the following packages replace it:
      r-base-core r-doc-info r-doc-html r-base-html r-base-core:i386
    

    我会说也许r-base-core。

    • -1

相关问题

  • Wubi 和常规的“Windows 旁边”安装有什么区别?

  • 如何在 Windows 7 中运行 Ubuntu?

  • 您对台式机和家庭服务器的驱动器分区方案有什么建议?[关闭]

  • 安装时,我可以选择加密我的主文件夹——这是做什么的?

  • 在不使用标准升级系统的情况下升级有哪些替代方案?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve