如何解决 Ubuntu 22.04 中 RStudio 的库依赖问题?

如何解决 Ubuntu 22.04 中 RStudio 的库依赖问题?

我刚刚安装了 Ubuntu 22.04。我可以使用以下命令安装 R sudo apt -y install r-base gdebi-core

$ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

但是当我尝试从下载的文件安装 Rstudio 时,我得到:

$ sudo gdebi rstudio-2022.02.1-461-amd64.deb 
[sudo] password for gigiux: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done
This package is uninstallable
Dependency is not satisfiable: libssl1.0.0|libssl1.0.2|libssl1.1

奇怪的是,流行的 deb 文件缺少一个基本库,另外还有:

$ sudo apt install libssl1.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.1
E: Couldn't find any package by glob 'libssl1.1'

在 Ubuntu 22.04 上安装 R 和 RStudio 的正确步骤是什么?

答案1

RStudio 目前正在准备一个修复此问题的版本。您可以下载他们的每日 deb,这不是已发布的版本,但我对其进行了测试,效果很好:

https://dailies.rstudio.com/rstudio/spotted-wakerobin/desktop/jammy/

以下是 RStudio 帖子(由 RStudio 员工发布),链接至上述 URL:

https://community.rstudio.com/t/dependency-error-when-installing-rstudio-on-ubuntu-22-04-with-libssl/135397/4

我希望所有后续的日报都能正常运行,但为了完整性,我在 Ubuntu 22.04 上测试的运行良好的日报是“rstudio-2022.06.0-daily-341-amd64.deb“。

答案2

我尝试了一些似乎有效的方法。我编辑了 RStudio 的桌面条目文件,并在 Exec 行中添加了 --no-sandbox 选项标志。当我单击 RStudio 应用程序图标(无论是桌面图标还是收藏夹栏中的启动器图标)时,这会自动更改执行的命令。

因此,首先转到文件夹 /usr/share/applications。在那里你会发现一个名为 rstudio.desktop 的文件。用文本编辑器打开此文件。内容可能如下所示:

[Desktop Entry]
Exec=/usr/lib/rstudio/bin/rstudio %F
Icon=rstudio
Type=Application
Terminal=false
Name=RStudio
Categories=Development;IDE;
MimeType=text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-quarto-markdown;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;application/x-r-project;application/x-rdp-rsp;text/x-r-history;text/x-r-profile;text/x-tex;text/x-markdown;text/css;text/javascript;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;

现在,您要做的就是在 Exec 行中的 %F 之前添加标志 --no-sandbox,如下所示:

[Desktop Entry]
Exec=/usr/lib/rstudio/bin/rstudio --no-sandbox %F
Icon=rstudio
Type=Application
Terminal=false
Name=RStudio
Categories=Development;IDE;
MimeType=text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-quarto-markdown;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;application/x-r-project;application/x-rdp-rsp;text/x-r-history;text/x-r-profile;text/x-tex;text/x-markdown;text/css;text/javascript;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;

进展如何?

答案3

我在搜索互联网后尝试了这些代码,发现这些代码有效

wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.2_amd64.deb
sudo gdebi ./libssl1.1_1.1.1l-1ubuntu1.2_amd64.deb
sudo gdebi rstudio-2022.02.1-461-amd64.deb

-accept 'y' 用于安装依赖项并触发使用 --no-sandbox 标记的 rstudio

rstudio --no-sandbox

这对我来说很成功

答案4

看起来上述链接在某些情况下可能有效,但我们需要等待 RStudio 团队的进一步修复和开发完全可以运行的 RStudio。

链接RStudio 每日更新

在此之前,rstudio --no-sandbox启动应用程序是一个更好的选择

@Thiago Albuquerque,--no-sandbox在 RStudio 执行程序中,在“%F”前添加“Exec=/usr/lib/rstudio/bin/rstudio %F”是由于权限问题而要求检查保存位置,因此无法在编辑时保存。如果可能的话,请给出解决方案,因为此策略可以绕过每次通过命令行手动执行。

相关内容