【问题标题】:Fatal error after updating to R 3.5.1 on Ubuntu 18.04 Server在 Ubuntu 18.04 服务器上更新到 R 3.5.1 后出现致命错误
【发布时间】:2018-09-24 14:27:22
【问题描述】:

在 Ubuntu 18.04 服务器上将 R 更新到 3.5.1 版本后,我收到此错误消息 fatal error: unable to open the base package 我尝试卸载并重新安装该软件包三次,但仍然出现相同的错误。我该如何解决这个问题?

这是我服务器上当前的 R 版本>>

IN: apt policy r-base

OUT: Installed: 3.5.1-1xenial
  Candidate: 3.5.1-1xenial
  Version table:
 * 3.5.1-1xenial 500
        500 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-1bionic 500
        500 http://ppa.launchpad.net/marutter/rrutter3.5/ubuntu bionic/main amd64 Packages
     3.5.0-1xenial 500
        500 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ Packages

更新

在尝试了 @duckmayr

的步骤之后

这是apt policy r-base的结果

r-base:
  Installed: (none)
  Candidate: 3.5.1-1bionic
  Version table:
     3.5.1-1bionic 500
        500 http://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 http://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.3-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.2-2xenial2 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.2-1xenial1 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.1-2xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.1-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.4.0-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.3.3-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.3.2-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.3.1-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.3.0-2xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.3.0-1xenial0 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages
     3.2.5-1xenial 500
        500 http://cran.wustl.edu/bin/linux/ubuntu xenial/ Packages

当我做sudo apt-get install r-base r-base-core时得到这个错误

    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.1-1bionic) but it is not going to be installed
 r-base-core : Depends: zip but it is not installable
               Depends: unzip but it is not installable
               Depends: libpaper-utils but it is not installable
               Depends: libcurl4 (>= 7.28.0) but it is not installable
               Depends: libpango-1.0-0 (>= 1.14.0) but it is not installable
               Depends: libpangocairo-1.0-0 (>= 1.14.0) but it is not installable
               Depends: libtcl8.6 (>= 8.6.0) but it is not installable
               Depends: libtiff5 (>= 4.0.3) but it is not going to be installed
               Depends: libtk8.6 (>= 8.6.0) but it is not installable
               Recommends: r-recommended but it is not going to be installed
               Recommends: r-base-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

并在尝试sudo apt install libcurl4-gnutls-dev libxml2-dev libssl-dev时获取此信息

 Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl4-gnutls-dev is already the newest version (7.58.0-2ubuntu3.3).
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:
 libssl-dev : Depends: libssl1.0.0 (= 1.0.2g-1ubuntu4.13) but 1.0.2n-1ubuntu5.1 is to be installed
              Recommends: libssl-doc but it is not going to be installed
 libxml2-dev : Depends: libxml2 (= 2.9.3+dfsg1-1ubuntu0.6) but 2.9.4+dfsg1-6.1ubuntu1.2 is to be installed
E: Unable to correct problems, you have held broken packages.

【问题讨论】:

  • 我从apt policy 输出中看到您安装了Xenial 包而不是Bionic 包;这是为什么?您在安装 Bionic 软件包时遇到问题吗?
  • 是的,我尝试安装仿生软件包,但在安装 R 软件包时遇到问题,因此我尝试使用以下命令安装 R:sudo add-apt-repository 'deb cloud.r-project.org/bin/linux/ubuntuxenial-cran35/ ' sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 sudo apt update。 sudo apt-get install r-base
  • 我会发布一个可以解决您问题的答案;请让我知道它是否有效!
  • which R 返回什么?
  • 如何从我的服务器中删除所有 R 版本,现在经过最后一次试用后有 4 个 R 版本( 3.5.1-1xenial 500、3.5.1-1bionic 500、3.5.0-1xenial 500 , 3.5.0-1bionic 500)

标签: r ubuntu apt ubuntu-18.04


【解决方案1】:

您似乎安装了适用于 R 3.5.1 的 Xenial (Ubuntu 16.04) 软件包,因此安装 Bionic (Ubuntu 18.04) 版本可能会解决您的问题。我有一个答案here 演示在 Linux Mint 19 上升级到 R 3.5.x,正如我解释的 here,这些说明对于 Ubuntu 18.04 也同样适用(因为 Mint 是基于 Ubuntu 的);我有一些运行 Mint 19 的机器和一些运行 Ubuntu 18.04 的机器,我对两者使用相同的进程。但是,这似乎并不完全是重复的,因为在遵循正确的安装过程之前您需要进行一些清理工作,并且您可以跳过一些步骤。这就是我会做的:

1。删除当前的 R 安装

你可以通过

sudo apt purge r-base

或者,如果你也有r-base-dev

sudo apt purge r-base r-base-dev

2。删除错误的仓库

您已添加以下存储库:

  1. ppa:marutter/rrutter3.5
  2. https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/

您应该可以通过

删除它们
sudo apt-add-repository --remove ppa:marutter/rrutter3.5
sudo apt-add-repository --remove 'deb cloud.r-project.org/bin/linux/ubuntu xenial-cran35/'

3。为 R 3.5.1 安装 Bionic 包

这遵循我上面链接的指南,但跳过了添加可信密钥的步骤,因为您已经这样做了;如果您运行以下命令,您应该没问题:

sudo echo "deb http://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install r-base r-base-dev

还要注意我已经安装了r-base r-base-dev,但我不知道你是否想要r-base-dev。我强烈推荐它。

然后,您应该能够获得一个新的 R 会话,您可以在其中运行

update.packages(checkBuilt = TRUE, ask = FALSE)

以确保您拥有所有以前安装的 R 包。

【讨论】:

  • 我在尝试启动 R 会话时遇到了同样的错误。
  • @omarahmedm93 感谢您的更新,将进一步调查。
  • 感谢您的努力,感谢 :)
  • @omarahmedm93 这个答案似乎没有解决你的问题,但它被标记为正确答案。我建议在发布正确答案之前删除“勾号”——我也需要同样的问题。
  • @kbrand 是的,我没有解决我的问题,我终止了我的服务器并创建了一个新实例,我接受了鸭子的回答以感谢他的帮助。
猜你喜欢
  • 1970-01-01
  • 2019-06-06
  • 2018-11-08
  • 2022-08-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-25
  • 2019-09-07
相关资源
最近更新 更多