如何在 Debian 上安装 2 个不同的 R 版本? [英] How to install 2 different R versions on Debian?

查看:35
本文介绍了如何在 Debian 上安装 2 个不同的 R 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的服务器上,按照 http://cran.r- 上的说明安装了 R 2.12.1project.org/bin/linux/debian/ ,使用 apt-get install 等.

On our server, R 2.12.1 is installed following the instructions on http://cran.r-project.org/bin/linux/debian/ , using apt-get install etc etc.

由于某些情况,旧的 lenny 机器尚未更新到新的稳定版 debian,而且看起来这不会很快发生.由于这里的一些研究依赖于最新版本的 VGAM,我们需要在 debian 上安装 R 2.14.0.但为了让旧代码继续运行,我们不能只删除 R 2.12.1(在此版本上安装 VGAM 0.8.4 会出错).

Due to circumstances the old lenny machine hasn't been updated to the new stable debian, and it looks like this isn't about to happen soon. As some of the research here depends on the latest version of VGAM, we need the R 2.14.0 installed on debian. But in order to keep old code running, we can't just drop the R 2.12.1 (installing the VGAM 0.8.4 on this version gives errors).

所以我们需要安装 2 个 R 版本.据我了解,如果我们只是使用 apt-get upgrade 旧版本将被新版本取代.我一直在浏览大量文档,但我找不到这样做的最佳方式.

So we need to install 2 R-versions. From the little I understood, if we just use apt-get upgrade the old version will be replaced by the new. I've been going through heaps of documentation, but I can't find the optimal way of doing so.

我现在唯一能想到的就是尝试从源代码构建最新的 R,但我的同事对这个想法并不十分热衷,并促使我首先寻找另一种解决方案.我错过了任何信息,或者有人愿意向我展示完成此任务的小技巧吗?如果从源代码构建是解决方案,我想了解任何陷阱或可能的问题.

The only thing I could imagine now, is to try to build the latest R from source, but my colleagues were not very keen on that idea and prompted me to first look for another solution. Any info I missed, or is somebody willing to show me the little trick to get this done? If building from source is the solution, I'd like to hear about any pitfalls or possible problems.

推荐答案

正如我在评论中提到的,这理论上是可能的,就像某些包系列(Emacs、PostgreSQL、...)允许多个并发版本.

As I mentioned in comments, this is theoretically possible just like some package families (Emacs, PostgreSQL, ...) allow multiple concurrent versions.

我现在不能提供这个,因为我们使用 /usr/{share,lib}/R 冲突.如果我要制作那个 /usr/{share,lib}/R-$version 然后使用 dpkg-alternatives 切换到默认的首选,我们可能会做.问题是过渡.此功能由少数用户使用,使用它可能会为大多数用户引入错误,直到它稳定为止.另外,我没有空闲时间(但如果其他人想这样做,请这样做).

I cannot offer that right now as we use /usr/{share,lib}/R which conflicts. If I were to make that /usr/{share,lib}/R-$version and then use dpkg-alternatives to flip to a default preferred one, we could possibly do it. The problem is the transition. This feature is used by a minority of user, getting to it may introduce bugs for a majority til this is stable. Plus, I do not have the spare time (but if someone else wants to do it, please do so).

在此期间,您可以

  1. 可能使用 dpkg 的高级功能并解压到本地目录,而不是 / 下面的默认目录 - 所以 /opt/R/oldversions/2.12.1 应该是可能的.R 甚至可以运行,你需要相应地重新定义 $RHOME.

  1. possibly use an advanced feature of dpkg and unpack to a local directory rather the default below / -- so /opt/R/oldversions/2.12.1 should be possible. R could even run, you need to redefine $RHOME accordingly.

如果您真的必须

如果某个特定的 CRAN/非 CRAN 包声称需要特定版本的 R,请修复该死的包!;-)

if a particular CRAN / non-CRAN package claims to need a particular version of R, fix the damn package already! ;-)

最后,这是 r-sig-debian 的主题,例如 CRAN 维护者 Michael 和 Johannes 不会在此处阅读此主题.

Finally, this is a topic for r-sig-debian as eg the CRAN maintainer Michael and Johannes won't read this thread here.

这篇关于如何在 Debian 上安装 2 个不同的 R 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆