update R in ubuntu

1、lsb_release -a : 查看系统信息
2、进入https://cran.r-project.org/bin/linux/ubuntu/README.html,找到相应R版本与系统对应的源。切换到root用户,将源添加到/etc/apt/sources.list中:suvi /etc/apt/sources.list

比如我要的是R3.6,linux系统是xenial 就选择了deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/还添加了清华的源deb https://mirrors.tuna.tsinghua.edu.cn/CRAN//bin/linux/ubuntu xenial-cran3

image.png

3、更新源并升级安装:apt-get update && apt-get upgrade
4、下载新版本: apt-get install r-base-dev

附:如果有使用r server 记得重启:rstudio-server restart,否则console的R版本仍然会是原来的低版本。

参考文献:
[1]https://stackoverflow.com/questions/10476713/how-to-upgrade-r-in-ubuntu?newreg=2f20875829024f9eb0a05e06a14abde1
[2]https://stackoverflow.com/questions/57104763/i-meet-some-troubles-when-i-updating-r-on-ubuntu
[3]https://www.jianshu.com/p/d1b456e2375a

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。