雅白

Programmer, Data Analyst and Gamer

github twitter rss
在 Ubuntu 上通过 APT 安装 R
Nov 5, 2016
已阅读了一分钟

R 不在 Ubuntu 的官方源中,通过包管理器安装需要添加源(CRAN)

CRAN is a network of ftp and web servers around the world that store identical, up-to-date, versions of code and documentation for R. Please use the CRAN mirror nearest to you to minimize network load. CRAN是世界范围内保存并分发统一、最新版本的 R 代码和文档的一个网络。请使用距离你最近的 CRAN 镜像。

https://cran.r-project.org/mirrors.html 可以查看所有 CRAN Mirror

这里以清华 TUNA 源 (https://mirrors.tuna.tsinghua.edu.cn/CRAN/) 为例

添加源

这里以 16.04 Xenial 为例,可自行替换为 wily/trusty/precise

deb http://mirrors.ustc.edu.cn/CRAN/bin/linux/ubuntu/ xenial/

添加 key

CRAN 存储的的包经由 KeyID E084DAB9 签名验证,需要添加 Key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

更新

sudo apt update
安装 R 基本版
sudo apt install r-base
安装 R 开发版(可编译R包)
sudo apt install r-base-dev

回到文章列表


comments powered by Disqus