1 安装R4.0,注意以下命令均需要管理员权限
# update indices
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: 298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
在这里,我们使用lsb_release-cs来访问您运行的Ubuntu风格:“hirsuite”、“groovy”、“focal”、“bionic”之一….然后运行下面代码来安装R和它的依赖库:
apt install --no-install-recommends r-base
然后,以root用户身份或以sudo前缀运行以下命令,以添加当前R 4.0或更高版本的“c2d4u”存储库:
add-apt-repository ppa:c2d4u.team/c2d4u4.0+

本文介绍如何在Ubuntu系统上安装R 4.0版本及其开发环境RStudio,包括添加存储库、安装依赖项及解决安装过程中可能遇到的问题。
最低0.47元/天 解锁文章
2797






