安装 r-base 时出现问题(以下软件包具有未满足的依赖关系。)

安装 r-base 时出现问题(以下软件包具有未满足的依赖关系。)

我正在尝试在 Ubuntu 上安装 R。我比较新,缺乏经验,所以可能犯了一个愚蠢的错误。我正在运行 Ubuntu 19.04

我正在使用 apt 安装 R: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 (>= 3.6.3-1bionic) but it is not going to be installed
          Depends: r-recommended (= 3.6.3-1bionic) 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.

我看过这个问题:添加 PPA 后如何解决未满足的依赖关系?寻求帮助。

我跑了

  • sudo apt-get update
  • sudo apt-get upgrade(0 表示升级,0 表示全新安装,0 表示删除,0 表示不升级。)

这些运行起来没有问题。

然后我就跑了sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

对此的回应是:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) wine-stable:amd64 < 3.0.1ubuntu1 -> 5.0.0~disco @ii umU Ib >
Broken wine-stable:amd64 Depends on wine-stable-i386:amd64 < none @un H > (= 5.0.0~disco)
  Considering wine-stable-i386:i386 0 as a solution to wine-stable:amd64 0
  Holding Back wine-stable:amd64 rather than change wine-stable-i386:amd64
 Try to Re-Instate (1) wine-stable:amd64
Done
Calculating upgrade... Done
The following packages have been kept back:
  wine-stable
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

因此我删除并重新安装了 wine-stable。重新运行调试时没有显示任何软件包。

我认为我的问题可能是由于我的 PPA 中的某些内容造成的。我禁用了其中几个。

的输出cat /etc/apt/sources.list为:

# deb cdrom:[Ubuntu 19.04 _Disco Dingo_ - Release amd64 (20190416)]/ disco main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ disco main restricted
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ disco-updates main restricted
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ disco universe
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco universe
deb http://gb.archive.ubuntu.com/ubuntu/ disco-updates universe
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ disco multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ disco-updates multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ disco-backports main restricted universe multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ disco-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu disco partner
# deb-src http://archive.canonical.com/ubuntu disco partner

deb http://security.ubuntu.com/ubuntu disco-security main restricted
# deb-src http://security.ubuntu.com/ubuntu disco-security main restricted
deb http://security.ubuntu.com/ubuntu disco-security universe
# deb-src http://security.ubuntu.com/ubuntu disco-security universe
deb http://security.ubuntu.com/ubuntu disco-security multiverse
# deb-src http://security.ubuntu.com/ubuntu disco-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
# deb https://dl.winehq.org/wine-builds/ubuntu/ disco main
# deb-src https://dl.winehq.org/wine-builds/ubuntu/ disco main
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
# deb-src https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
# deb http://cran.rstudio.com/bin/linux/ubuntu disco/
# deb-src http://cran.rstudio.com/bin/linux/ubuntu disco/

的输出cat /etc/apt/sources.list.d/*是:

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
# deb http://ppa.launchpad.net/jonathonf/gcc-7.1/ubuntu disco main
# deb http://ppa.launchpad.net/jonathonf/gcc-7.1/ubuntu disco main
deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu disco main
# deb-src http://ppa.launchpad.net/obsproject/obs-studio/ubuntu disco main
deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu disco main
# deb-src http://ppa.launchpad.net/obsproject/obs-studio/ubuntu disco main

通过“软件和更新”->“其他软件”,我取消勾选了一些可能有帮助或使事情恶化的项目:

软件与更新

希望我提供的内容对您有所帮助。如果您需要更多详细信息,请告诉我。

答案1

这是一个简单的修复。bionic-cran35 正在尝试运行,因为它存在于 source.list 中。这是之前安装失败的结果。注释掉

deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ 

代码中的行已经修复了这个问题。

Bionic 源自以前的 Ubuntu 发行版,并已于 19.04 被 Disco 取代。

感谢@steeldriver 指出我的缺点。

相关内容