无法安装 R 基础;未满足的对 Ubuntu 18.04 的依赖

Dan*_*uah 7 dependencies r 18.04

我正在尝试在 Ubuntu 18.04 机器上安装 R,但遇到了“未满足的依赖项”问题。但是,我无法确定我可以去哪里或者我需要在我的系统上修复什么来克服这个问题。任何帮助将不胜感激。

我正在运行 Ubuntu 18.04.2 LTS(带有 16Gb RAM 和 500Gb 硬盘),仅使用标准bionic存储库;我添加的唯一 PPA 是用于 libreoffice 的。看到那里的东西后,输出到sudo apt updateIS

Ign:1 http://dl.google.com/linux/chrome-remote-desktop/deb stable InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease   
Hit:3 http://dl.google.com/linux/chrome-remote-desktop/deb stable Release
Hit:4 http://dl.google.com/linux/chrome/deb stable Release                 
Get:7 https://desktop-download.mendeley.com/download/apt stable InRelease [2,456 B]
Get:8 https://typora.io/linux ./ InRelease [758 B]                         
Hit:9 http://repository.spotify.com stable InRelease                       
Hit:10 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Hit:11 http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease    
Hit:12 http://sg.archive.ubuntu.com/ubuntu bionic InRelease                
Hit:13 http://sg.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:14 http://sg.archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Fetched 91.9 kB in 3s (26.5 kB/s)    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Run Code Online (Sandbox Code Playgroud)

(我尽量保持同步sudo apt update && sudo apt upgrade,至少每两天运行一次。)

当我尝试安装第一个 R 组件r-base(通过sudo apt install r-base)时,我得到以下未满足的依赖项:

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.4.4-1ubuntu1) but it is not going to be installed
          Depends: r-recommended (= 3.4.4-1ubuntu1) 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.
Run Code Online (Sandbox Code Playgroud)

运行software-properties-gtk,我看到所有存储库都已启用。运行sudo apt-get cleansudo apt-get autoclean继续完成,没有错误消息。当我执行

$ sudo apt-get -f install
$ sudo dpkg --configure -a
$ sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)

输出是

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

所以我的系统上似乎没有保留、冲突或损坏的软件包。我也执行过sudo apt --fix-broken install,但同样,如上所述,我的系统似乎没有保留或损坏的包。

跑步sudo apt-get dist-upgrade节目

Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
Calculating upgrade... Done 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

我很乐意尝试其他人可能想要建议的任何其他内容,以查看故障是否仍然存在于我的系统上。

接下来我添加

deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
Run Code Online (Sandbox Code Playgroud)

跑到我的/etc/apt/sources.list身边

$ sudo apt update
$ sudo apt install r-base
Run Code Online (Sandbox Code Playgroud)

仍然没有快乐;输出现在是(省略上面的重复)

The following packages have unmet dependencies:
 r-base : Depends: r-base-core (>= 3.6.0-2bionic) but it is not going to be installed
          Depends: r-recommended (= 3.6.0-2bionic) 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.
Run Code Online (Sandbox Code Playgroud)

(但至少我已经从3.4.4-1ubuntu13.6.0-2bionic。)重复sudo apt-get -f install ; sudo dpkg --configure -a; sudo apt-get -f install上面的序列继续显示

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

所以再次似乎没有持有或冲突的包裹。

的输出apt-cache policy r-base是:

  Installed: (none)
  Candidate: 3.6.0-2bionic
  Version table:
     3.6.0-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.6.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.3-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://sg.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://sg.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
Run Code Online (Sandbox Code Playgroud)

但是,我不确定根据此输出进一步挖掘或调整哪些文件。

是否有我需要添加到我的位置/etc/apt/sources.list以放置对r-base-core和的依赖项r-recommended?我还需要去哪里才能得到它们?linux安装页面

https://cran.ma.imperial.ac.uk/bin/linux/ubuntu/README.html
Run Code Online (Sandbox Code Playgroud)

不会向我建议任何进一步添加到我的/etc/apt/sources.list. Google 返回了一大堆其他东西,包括marutter的 PPA,我已经尝试将它们添加到我的源中,但没有一个允许我安装完成。[是,当我把他们赶走,我已确认通过运行cleanautoclean每一次,如上]

需要明确的是,我并不痴迷于拥有绝对最新版本的 R/我也会对任何其他稍微过时的东西感到满意,但是我在 R 的 linux 安装页面上没有看到任何我可能会调整的提示.

(在我的其他机器上,GalliumOS 2.1 和 GalliumOS 3.0,我已经安装了 R 和 RStudio,没有问题。)

任何帮助将不胜感激。

(这个问题现在已经解决,如下所述;我有两个稍微不一致的软件包版本。我最终删除了两个并重新安装了一个。)

Dan*_*uah 7

在跟踪了许多路径上的一系列失败之后,我开始确信——正如@user535733 所建议的那样,“进入兔子洞”——不知何故,似乎有两个不同的来源悄悄进入了我的系统,每个来源都单独提供了一致的一套完整的包,但跨越两者互不兼容。一个例子是发现同时gcc-8-base引用8.3.0-6ubuntu1~18.048-20180414-1ubuntu2,但还有其他的,最终发现太多而无法一次解决。

所以我删除并恢复了默认存储库,例如,如何恢复默认存储库?通过移动/etc/apt/sources.list到某个安全的临时位置 [在一切正常后将被丢弃],- touching 创建一个新的空版本,然后using software-properties-gtk提供一组新的 Ubuntu 软件源和更新(securityupdates渠道)。关闭它以便系统更新,然后在终端中我运行

$ sudo apt update && sudo apt upgrade
$ sudo apt install r-base # Works cleanly!
Run Code Online (Sandbox Code Playgroud)

(非常感谢所有帮助过的人,但最重要的是@user535733)