更新时间:2023-01-14 16:14:05浏览次数:836+次
如何在Ubuntu 22.04 Linux系统上轻松安装R和RStudio?本文将给出答案。先像往常一样,更新系统包索引,并将所有已安装的包升级到最新版本,运行sudo apt update和sudo apt -y upgrade命令。
在Ubuntu 22.04上安装R
我们需要安装r-base包,它包含基本的R函数,可以让您在R中执行算术运算和基本编程。使用下面的命令进行安装:
sudo apt -y install r-base
在Ubuntu 22.04上下载并安装RStudio
现在访问RStudio下载页面https://www.rstudio.com/products/rstudio/download/#download,获取基于Debian的Linux发行版的RStudio最新版本或选定的,如2022.02.2-485:
wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-2022.02.2-485-amd64.deb
sudo apt install -f ./rstudio-2022.02.2-485-amd64.deb
或:
wget https://download1.rstudio.org/electron/bionic/amd64/rstudio-2022.12.0-353-amd64.deb
sudo apt install -f ./rstudio-2022.12.0-353-amd64.deb
出现提示时继续安装:
The following additional packages will be installed:
lib32gcc-s1 lib32stdc++6 libc6-i386 libclang-10-dev libclang-common-10-dev libclang-dev libclang1-10 libgc1c2 libllvm10 libobjc-9-dev libobjc4 libpq5 libxcb-xkb1 libxkbcommon-x11-0 libxkbcommon0
The following NEW packages will be installed:
lib32gcc-s1 lib32stdc++6 libc6-i386 libclang-10-dev libclang-common-10-dev libclang-dev libclang1-10 libgc1c2 libllvm10 libobjc-9-dev libobjc4 libpq5 libxcb-xkb1 libxkbcommon-x11-0 libxkbcommon0
rstudio
0 upgraded, 16 newly installed, 0 to remove and 91 not upgraded.
Need to get 51.2 MB/168 MB of archives.
After this operation, 1169 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
完成后在Ubuntu 22.04上启动RStudio,请从桌面环境的应用程序搜索或终端启动RStudio:
对于终端,运行:
$ rstudio
Ubuntu 22.04应用程序崩溃修复
在Ubuntu 22.04上,您在尝试启动应用程序时可能会遇到问题。首先安装openssl 1.1,如下所示:
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.2_amd64.deb
sudo apt-get install ./libssl1.1_1.1.1l-1ubuntu1.2_amd64.deb
一旦完成,在没有sandbox的情况下启动Rstudio:
rstudio --no-sandbox
它的UI看起来像这样:
至此,在Ubuntu 22.04系统上安装Rstudio已经成功。
相关资讯