[英]ansible r-base 3.2 install on debian
要在 debian 8“Jessie”上獲得 r-base 3.2 版,我使用文檔:
https://cran.r-project.org/bin/linux/debian/#debian-jessie-stable並在 Linux Mint 17.1 (MATE) 上安裝最新版本的 R 3.2.1 (World-Famous Astronaut)
總之我們添加
deb http://<favourite-cran-mirror>/bin/linux/debian jessie-cran3/
到文件 /etc/apt/sources.list 並最終使用以下命令對其進行簽名:
apt-key adv --keyserver keys.gnupg.net --recv-key 381BA480
在ansible 中執行此操作的正確方法是什么?
正如弗蘭克建議的那樣,使用apt-key
和apt-repository
模塊應該很簡單:
- name: Add the APT key for official R repository
apt_key: id="381BA480" keyserver="pgp.mit.edu" state=present
- name: Ensure APT official R repository
apt_repository: repo="deb http://mirror.ibcp.fr/pub/CRAN/bin/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }}-cran3/"
這應該使用以下內容創建文件/etc/apt/sources.list.d/mirror_ibcp_fr_pub_CRAN_bin_linux_debian.list
:
deb http://mirror.ibcp.fr/pub/CRAN/bin/linux/debian jessie-cran3/
您現在可以使用apt
模塊:
- name: Install the R packages
apt: name=r-base install_recommends="yes" state=present
請注意,顯然可以根據需要調整<favourite-cran-mirror>
或密鑰服務器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.