deepin20.9安装R-3.5.2和最新R- 4.3.2的步骤方法

R是很好用的一个软件,但是最新遇到重装系统,发现原来的R不是很听话,安装以前没有问题的包竟然装不上。安装新软件,运行R studio也出问题。这篇文章总结了安装中的问题。

一、安装R-3.5.2

sudo apt update
sudo apt install r-base r-base-dev

 然后安装R studio,但现在似乎要安装ggplot2包等会提示缺依赖。我没有记录所缺的依赖,印象中缺的依赖与下面新版本缺的依赖是差不多的。

二、安装R-4.3.2

安装步骤:
1、从服务器安装Posit - Install R - Posit Documentation

安装说明在这里:Posit - Install R - Posit Documentation

sudo apt-get update

sudo apt-get install gdebi-core


2、查看debian版本

cat /etc/debian_version

​确定我的电脑deepin20.9为debian10.10

3.选择软件版本

export R_VERSION=4.3.2

4.下载和安装R

$  curl -O https://cdn.rstudio.com/r/debian-10/pkgs/r-${R_VERSION}_1_amd64.deb

$  sudo gdebi r-${R_VERSION}_1_amd64.deb


5.确认R安装

/opt/R/${R_VERSION}/bin/R --version
​
结果显示为:
Light@Light-PC:~$ /opt/R/${R_VERSION}/bin/R --version
R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

​到这里提示安装R4.3.2成功了。


6.创建软连接

$ sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R

$ sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript

7.System Requirements Coverage

apt-get install libgdal-dev gdal-bin libproj-dev

​8.安装缺失的依赖

sudo apt install libopenblas-dev
sudo update-alternatives --config libblas.so.3-$(arch)-linux-gnu
sudo apt-get install \ curl \ gcc \ libbz2-dev \ libev-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ libncurses-dev \ libreadline-dev \ libsqlite3-dev \ ==libssl==-dev \ make \ tk-dev \ wget \ zlib1g-dev

此时下载ggplot2包还是存在问题,提示缺依赖。主要缺的是以下:

‘colorspace’, ‘utf8’, ‘farver’, ‘labeling’, ‘munsell’, ‘R6’, ‘RColorBrewer’, ‘viridisLite’, ‘fansi’, ‘magrittr’, ‘pillar’, ‘pkgconfig’, ‘cli’, ‘glue’, ‘gtable’, ‘isoband’, ‘lifecycle’, ‘rlang’, ‘scales’, ‘tibble’, ‘vctrs’, ‘withr’

于是在r里面安装以上缺的这些依赖。

至此,R就能够下载安装ggplot2等包了。在没有安装上述8中的依赖之前,是不能够下载包的。

注意避坑:此时安装R studio应选择与操作系统linux版本对应的R studio安装,否则如果安装了debian11或debian12对应的R studio,R studio运行则会出现下面的提示:

/usr/lib/rstudio/resources/app/bin/rsession: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

9.安装r studio

在官网上找到Previous Versions中,RStudio IDE / Workbench里面View Previous Versions,在2023.03.0中找到如下:

 下载后安装完成,就能正常使用R studio了。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rh4751

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值