Script download latest R to new Debian machine

I am working on an Amazon Elastic Map Reduce service and I want to download the latest version of R on each node. Each node is a fairly simple installation of Debian Lenny. I wrote a simple script shell that seems to do the job, but I'm curious if there are any better ways or other things that I should consider in the 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 
+4
source share
1 answer

Looks nice!

Two minor hints

  • A new way to add repositories without changing /etc/apt/sources.list is to delete the file, say. cran.list with repo information in the /etc/apt/sources.list.d/ subdirectory.

  • You may not need the deb-src line if you do not plan to rebuild packages on these nodes.

+4
source

Source: https://habr.com/ru/post/1332531/


All Articles