将最新的R加载到新的Debian机器上的脚本 [英] Script to load latest R onto a fresh Debian Machine
问题描述
#!/ 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屋!