将最新的R加载到新的Debian机器上的脚本 [英] Script to load latest R onto a fresh Debian Machine

查看:107
本文介绍了将最新的R加载到新的Debian机器上的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事亚马逊弹性地图缩小服务,我想将最新版本的R引导到每个节点。每个节点都是Debian Lenny的基本安装。我写了一个简单的shell脚本,似乎完成了工作,但是如果在下面的脚本中有更好的方法或其他的东西我应该考虑,我很好奇:

 #!/ bin / bash 

#如果不想使用主CRAN镜像,请更改这些行。
#debian R upgrade
echodeb http://cran.r-project.org/bin/linux/debian lenny-cran /| sudo tee -a /etc/apt/sources.list
echodeb-src http://cran.r-project.org/bin/linux/debian lenny-cran /| sudo tee -a /etc/apt/sources.list

#加密键到键盘,所以它不抱怨
gpg --keyserver pgp.mit.edu --recv-key 381BA480
gpg -a --export 381BA480> jranke_cran.asc
sudo apt-key add jranke_cran.asc

#安装最新的R
sudo apt-get更新
sudo apt-get -t lenny-cran安装--yes --force-yes r-base r-base-dev


解决方案

看起来不错!



两个小提示是




  • 添加repos的新方法没有改变 /etc/apt/sources.list 就是删除一个文件,比如说。 cran.list 将repo信息放入子目录 /etc/apt/sources.list.d /


  • 除非您计划在这些节点上重建软件包,否则可能不需要 deb-src / p>



I'm working on Amazon's Elastic Map Reduce service and I want to bootstrap the latest version of R on to every node. Each node is a pretty basic install of Debian Lenny. I've written a simple shell script that seems to get the job done, but I'm curious if there are better ways or other things I should consider in my script below:

#!/bin/bash

# Change these lines if you don't want to use the main CRAN mirror.
# debian R upgrade
echo "deb http://cran.r-project.org/bin/linux/debian lenny-cran/" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://cran.r-project.org/bin/linux/debian lenny-cran/" | sudo tee -a /etc/apt/sources.list

# add key to keyring so it doesn't complain 
gpg --keyserver pgp.mit.edu --recv-key 381BA480
gpg -a --export 381BA480 > jranke_cran.asc
sudo apt-key add jranke_cran.asc

# install the latest R
sudo apt-get update
sudo apt-get -t lenny-cran install --yes --force-yes r-base r-base-dev

解决方案

Looks good me!

Two minor hints are

  • A newfangled way of adding repos without altering /etc/apt/sources.list is to drop a file, say. cran.list with the repo information into the subdirectory /etc/apt/sources.list.d/.

  • You may not need the deb-src line unless you plan to rebuild the packages on those nodes.

这篇关于将最新的R加载到新的Debian机器上的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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