简体   繁体   English

如何自动将R更新到最新的修补版本?

[英]How to automatically update R to the latest patched version?

有什么方法可以每天或以预定的间隔自动将Mac OS X上的R更新到最新的修补版本(R-Patched)?

My impression is that compiling from source is the most (only?) reliable way to get the most recent patched version, but I could be wrong about this. 我的印象是,从源代码进行编译是获取最新修补程序版本的最可靠的方法,但是我对此可能是错误的。 A simple shell script to download the latest patched version and recompile would be: 一个用于下载最新补丁版本并重新编译的简单shell脚本为:

curl -o /tmp/R-patched.tar.gz ftp://ftp.stat.math.ethz.ch/Software/R/R-patched.tar.gz
tar xzvf /tmp/R-patched.tar.gz
cd /tmp/R-patched
./configure
make
cp bin/R <old_R_binary_location>

You could then use crontab to run this at regular intervals. 然后,您可以使用crontab定期运行此操作。 I don't find the crontab man page to be very helpful, so I always end up referring back to guides such as this one . 我没有找到crontab的手册页是非常有帮助的,所以我总是最后再参考指南,如这一个

I have a bash script that installs the daily patched build from http://r.research.att.com . 我有一个bash脚本,可以从http://r.research.att.com安装每日修补的版本。 Installed libraries remain untouched, except for those in core. 除核心库外,已安装的库保持不变。

I update manually, but you could set up a cron job as @bnaul suggests. 我手动更新,但是您可以按照@bnaul的建议设置cron作业。 I'm not sure how it will handle the need for sudo'ing, however. 但是,我不确定它将如何处理sudo'ing的需求。 You might have to move your R out of /Library/Frameworks and then change the script accordingly. 您可能必须将R移出/ Library / Frameworks,然后相应地更改脚本。

#!/bin/bash
curl -s http://r.research.att.com/R-2.13-branch-leopard-universal.tar.gz | sudo tar fvxz - -C /

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

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