美文网首页
在ubutnu上安装最新R的方法

在ubutnu上安装最新R的方法

作者: 王梓维 | 来源:发表于2024-07-01 09:59 被阅读0次

直接用apt安装的R版本只有3.6,有部分R包不能使用.在网上找了一圈教程,发现都成功,最后在清华源的CRAN官网上终于找到可靠的方法:https://mirrors.tuna.tsinghua.edu.cn/CRAN/

首先运行这几个代码

# update indices
sudo apt update -qq
# install two helper packages we need
sudo 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: E298A3A825C0D65DFD57CBB651716619E084DAB9
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
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

#就可以安装R 4.4.1
sudo apt install --no-install-recommends r-base

相关文章

网友评论

      本文标题:在ubutnu上安装最新R的方法

      本文链接:https://www.haomeiwen.com/subject/qvdmcjtx.html