将最新的 R 加载到新的 Debian 机器上的脚本 [英] Script to load latest R onto a fresh Debian Machine
问题描述
我正在开发 Amazon 的 Elastic Map Reduce 服务,我想将最新版本的 R 引导到每个节点.每个节点都是 Debian Lenny 的一个非常基本的安装.我编写了一个简单的 shell 脚本,似乎可以完成工作,但我很好奇是否有更好的方法或其他我应该在下面的脚本中考虑的事情:
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
推荐答案
看起来不错!
两个小提示是
在不改变
/etc/apt/sources.list
的情况下添加 repos 的一种新方法是删除文件,比如说.cran.list
将 repo 信息放入子目录/etc/apt/sources.list.d/
.
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/
.
您可能不需要 deb-src
行,除非您计划在这些节点上重建包.
You may not need the deb-src
line unless you plan to rebuild the packages on those nodes.
这篇关于将最新的 R 加载到新的 Debian 机器上的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!