简体   繁体   English

是否无法在 Ubuntu 18.04.4 LTS 上安装 R 4.0,因为 r-base-core 需要 libc6 版本 >= 2.29?

[英]Is it impossible to install R 4.0 on Ubuntu 18.04.4 LTS because r-base-core requires a libc6 version >= 2.29?

I am trying to install R 4.0 on Ubuntu 18.04.4 LTS but I keep getting errors of我正在尝试在 Ubuntu 18.04.4 LTS 上安装 R 4.0,但我不断收到以下错误

> sudo apt install 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-core : Depends: libc6 (>= 2.29) but 2.27-3ubuntu1 is to be installed
               Depends: libicu66 (>= 66.1-1~) but it is not installable
               Depends: libreadline8 (>= 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
               Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

when trying to install.尝试安装时。 I have removed and deleted R 3.6.3 and have added我已经删除并删除了 R 3.6.3 并添加了

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

in my /etc/apt/sources.list file.在我的/etc/apt/sources.list文件中。 Note that the above requires libc6 (>= 2.29) yet from what I have seen, it is NOT AVAILABLE for 18.04.请注意,上面需要libc6 (>= 2.29) ,但据我所知,它不适用于 18.04。 Does this mean I have to upgrade to 19.04, or 20.04 in order to run R 4.0?这是否意味着我必须升级到 19.04 或 20.04 才能运行 R 4.0?

I am using Ubuntu 18.04, for this there should be a single source deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ in /etc/apt/sources.list Unfortunately, I added deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ by mistake which I removed to install R 4.0 R is successfully installed now.我正在使用 Ubuntu 18.04,为此应该有一个源deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/在 /etc/apt/sources.list 不幸的是,我添加了deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/错误地删除了它以安装 R 4.0 ZE1E1D3D40573127E9EE0480DAF128 现在已成功安装

The problem may to be with your /etc/apt/sources.list .问题可能出在您的/etc/apt/sources.list上。 Please check whether you have disabled all other repositories for R in there, eg it should not contain lines like deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/请检查您是否已在其中禁用 R 的所有其他存储库,例如它不应包含像deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/

Question: Is your system otherwise current to 18.04?问题:您的系统是否是 18.04 的最新版本? If so, the upgrade should just work .如果是这样,升级应该可以正常工作 I wrote a blog post (prior to the release) about testing R 4.0.0 on 18.04 along with a video:我写了一篇关于在 18.04 上测试 R 4.0.0 的博客文章(在发布之前)以及一个视频:

Two more recent (related) posts at http://dirk.eddelbuettel.com/blog/code/r4/ as well. http://dirk.eddelbuettel.com/blog/code/r4/最近的两个(相关)帖子也是如此。

In short, on a system that is otherwise well (ie no other packages forced or conflicts or what have you), one just adds the new repo (shown in slides and video), updates the apt index and upgrades.简而言之,在一个其他方面都很好的系统上(即没有其他包被强制或冲突或你有什么),只需添加新的 repo(显示在幻灯片和视频中),更新apt索引和升级。 I have done the same for my 19.10 Ubuntu system in another video.我在另一个视频中为我的 19.10 Ubuntu 系统做了同样的事情。

For Ubuntu User对于 Ubuntu 用户

sudo nano /etc/apt/sources.list须藤纳米 /etc/apt/sources.list

Remove each line which is similar of the below given path删除与下面给定路径相似的每一行

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

save it and exit from editor保存并退出编辑器

Then try to install R 4.1.3 as per the given way from the below link然后尝试按照以下链接中给定的方式安装 R 4.1.3

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

I have 18.04 and want R 4.x我有 18.04,想要 R 4.x

I had to edit the etc/apt/sources.list to我必须将 etc/apt/sources.list 编辑为

  1. not have R 3.5 in the sources来源中没有 R 3.5
  2. instead of having '... focal-cran40/' to have '... bionic-cran40/'.而不是让“... focal-cran40/”有“... bionic-cran40/”。

Then I used然后我用

sudo apt update
sudo apt install r-base

and it all worked一切都奏效了

Yes.是的。 It may be a bug in that specific package/version but you should upgrade to a newer Ubuntu version if you wish to use that package.这可能是该特定软件包/版本中的错误,但如果您希望使用package,您应该升级到更新的 Ubuntu 版本。

Upgrading Ubuntu is achieved using the command sudo do-release-upgrade .使用命令sudo do-release-upgrade升级 Ubuntu 。 This assumes your user is authorised to run root/administrative commands.这假设您的用户有权运行 root/管理命令。 More detail may be found on the Ubuntu community site .更多详细信息可在Ubuntu 社区网站上找到。

If waiting for a fix or upgrading aren't palatable, you may find running R in a Docker container is a better solution.如果等待修复或升级不愉快,您可能会发现在 Docker 容器中运行 R 是更好的解决方案。 This is an increasingly common method for running awkward development tools.这是运行笨拙的开发工具的一种越来越普遍的方法。

I just met the same problems while install R 4.0 on Ubuntu 20.04 here is my solutions.我刚刚在 Ubuntu 20.04 上安装 R 4.0 时遇到了同样的问题,这是我的解决方案。 first I just want install R instead of r-base-core and so on.首先我只想安装 R 而不是 r-base-core 等等。 it didn't work that install all the r-base-core and r-base-dev so on.安装所有 r-base-core 和 r-base-dev 以此类推是行不通的。 read the official document https://cran.r-project.org/bin/linux/ubuntu/#install-r carefully.仔细阅读官方文档https://cran.r-project.org/bin/linux/ubuntu/#install-r if the problems still exist, try renew /etc/apt/sources.list use the complete document or cope the backup ones如果问题仍然存在,请尝试更新/etc/apt/sources.list使用完整文件或处理备份文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM