【问题标题】:Unable to install R 4.0 on Linux Mint 19.1 Tessa无法在 Linux Mint 19.1 Tessa 上安装 R 4.0
【发布时间】:2021-04-21 13:02:04
【问题描述】:

我已经尝试了好几天了。我想升级到最新版本的 R。我已遵循此链接上的建议: Problem installing R4.0 on LInux Mint 19.3

但对我来说,问题仍然存在。 当我这样做时

echo -e "\ndeb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" | sudo tee -a /etc/apt/sources.list
then
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo apt-get 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-recommended (= 4.0.5-1.1804.0) but it is not going to be installed
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
E: Unable to correct problems, you have held broken packages.

如果有人知道如何解决这个问题,我将永远感激不尽。

【问题讨论】:

  • 不确定这是否是主要问题,但您的 /etc/apt/sources.list 中似乎有重复条目。如果它们被配置为类似的存储库但略有不同,我想知道它是否会引入冲突。仅供参考,我更喜欢在 /etc/apt/sources.list.d/ 的单个文件中添加个人(每个站点)deb 包存储库,而不是主 sources.list 文件;它似乎更易于维护,并且可以很好地分开。
  • 我怀疑“你持有破损的包裹”也是一个问题。我在处理损坏/不完整/持有的包裹方面不够熟练,但请查看 dpkg -l | grep -Ev '^(ii|rc)' 看看是否有什么突出的地方。
  • 检查 r2evans cmets 后,尝试这些说明cloud.r-project.org/bin/linux/ubuntu
  • 哦,是的,我确实在 /etc/apt/sources.list 中有重复的条目我想我需要这个 deb cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ 但我同时拥有上述和前者是 deb cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
  • 当我到达 ~$ apt install --no-install-recommends software-properties-common dirmngr 时,我确实尝试按照此处的说明进行操作 cloud.r-project.org/bin/linux/ubuntu software-properties-common 已经是最新版本(1.8.4)。 dirmngr 已经是最新版本(2.2.4-1ubuntu1.4)。 0 个已升级,0 个新安装,0 个要移除,19 个未升级。

标签: r linux ubuntu installation


【解决方案1】:

W: Target Translations (en_US) 在 /etc/apt/sources.list:5 和 /etc/apt/sources.list:7 中配置了多次

删除源中的重复条目(第 5 行和第 7 行):

sudo sed -i '7d' /etc/apt/sources.list

以下包具有未满足的依赖关系: r-base :取决于:r-recommended (= 4.0.5-1.1804.0) 但不会安装

使用以下命令:

sudo apt update
sudo apt install --no-install-recommends r-base

【讨论】:

  • 我认为它起作用了对不起我喊了
【解决方案2】:

这篇文章:

https://unix.stackexchange.com/a/612316/367012

说 Mint 在添加存储库方面与 Ubuntu 不同,并建议手动编辑存储库列表,

$ sudo xed /etc/apt/sources.list.d/additional-repositories.list

添加:

deb cloud.r-project.org/bin/linux/ubuntu bionic-cran40/

保存退出编辑器,然后更新包列表:

$ sudo apt update

这篇帖子:https://askubuntu.com/a/1113944/968912 建议先删除所有以前的 R 版本。

【讨论】:

  • 是的,我都已经做过了,非常感谢你提供这个链接!
  • 您是否能够安装 R 4,或者您是否更新了错误消息。没有提到的一件事是,在所有这些编辑和安装之后,尝试将其关闭并重新打开:) 另一个是 $ sudo apt update 在编辑回购列表后需要运行。
  • 关闭再打开是迄今为止最好的方法,这就是为什么我做了 953 次。我在安装 devtools 时遇到了麻烦,我通过运行 sudo apt-get install libcurl4-openssl-dev --fix-broken 解决了这个问题(我希望?)我刚刚再次运行 sudo apt update,我的终端告诉我有 25 个包可以被更新,所以我跑了 apt list --upgradable :
  • 它告诉我这样的事情:libgl1-mesa-dri/bionic-updates 20.0.8-0ubuntu1~18.04.1 i386 [可升级自:19.0.8-0ubuntu0~18.04.1] .. .加上一些可以升级的R包。
猜你喜欢
  • 1970-01-01
  • 2020-06-22
  • 2015-01-03
  • 2023-03-04
  • 2014-01-01
  • 2019-11-10
  • 1970-01-01
  • 2020-07-06
  • 2020-08-24
相关资源
最近更新 更多