首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试在Linux mint 20.2中安装Tidyverse

尝试在Linux mint 20.2中安装Tidyverse
EN

Stack Overflow用户
提问于 2021-08-31 03:00:24
回答 2查看 558关注 0票数 0

在过去的几天里,我一直在努力让RStudio打开或关闭,最终让它运行起来,并开始安装包。Readr安装得很好,但tidyverse拒绝安装。

代码语言:javascript
复制
/usr/bin/ld: /usr/local/lib/libcrypto.a(v3_genn.o): relocation R_X86_64_PC32 against symbol `GENERAL_NAME_it' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:6: openssl.so] Error 1
ERROR: compilation failed for package ‘openssl’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status
ERROR: dependency ‘openssl’ is not available for package ‘ids’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/ids’
Warning in install.packages :
  installation of package ‘ids’ had non-zero exit status
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/httr’
Warning in install.packages :
  installation of package ‘httr’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘gargle’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/gargle’
Warning in install.packages :
  installation of package ‘gargle’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘rvest’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/rvest’
Warning in install.packages :
  installation of package ‘rvest’ had non-zero exit status
ERROR: dependencies ‘gargle’, ‘httr’ are not available for package ‘googledrive’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/googledrive’
Warning in install.packages :
  installation of package ‘googledrive’ had non-zero exit status
ERROR: dependencies ‘gargle’, ‘googledrive’, ‘httr’, ‘ids’ are not available for package ‘googlesheets4’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/googlesheets4’
Warning in install.packages :
  installation of package ‘googlesheets4’ had non-zero exit status
ERROR: dependencies ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/home/william/R/x86_64-pc-linux-gnu-library/3.6/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpyoCTNu/downloaded_packages’

为了解决这个问题,我尝试了两个方面的建议:

第一个选项是'sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev‘

来自本网站:https://blog.zenggyu.com/en/post/2018-01-29/installing-r-r-packages-e-g-tidyverse-and-rstudio-on-ubuntu-linux/

第二个是'sudo apt-get install r-base-dev unibxml2-dev libssl-dev libcurl4-openssl-dev unixodbc- xml2‘

来自rstudio社区页面:https://community.rstudio.com/t/cant-install-tidyverse/29293

我发现的第三个选项对我来说在没有指导的情况下太高级了:如果已经安装了openssl,检查'pkg-config‘是否在您的路径中,并且PKG_CONFIG_PATH是否包含一个openssl.pc文件。如果pkg-config不可用,您可以通过以下命令手动设置INCLUDE_DIR和LIB_DIR :R INSTALL --configure-vars=‘INCLUDE_DIR... LIB_DIR=...’

我肯定我做错了什么。我认为有些东西可能不在正确的位置,或者链接到了错误的位置。任何帮助都将不胜感激。

(另外,作为参考,这是我第一次使用linux,所以请尽可能地简化回答)

EN

回答 2

Stack Overflow用户

发布于 2021-09-14 02:44:10

我现在已经让它起作用了。通过查看错误消息,我发现了在安装tidyverse (和运行)之前需要安装的依赖项。

最好安装最新版本的R,但不是必需的。我遵循了本教程中的步骤:https://linuxconfig.org/how-to-install-rstudio-on-ubuntu-20-04-focal-fossa-linux

为了把所有的东西放在一个地方,我把步骤放在这里:

步骤1:

$ sudo apt update

$ sudo apt -y install r-base gdebi-core

第2步:从他们的网站安装Rstudio

第3步:对于这一步,请确保您位于已下载文件的文件夹中,对于我来说,位于downloads中

$ sudo gdebi rstudio-1.2.5019-amd64.deb

步骤4:打开Rstudio

为了让tidyverse正常工作,我的错误消息都是关于非零退出状态的。我所做的就是仔细检查,找到没有正确安装的软件包,然后手动安装它们。

我的第一个问题是curl。我先试着在Rstudio中安装它。当我得到一个错误时,我进入终端并安装了

sudo apt-get install libcurl4-openssl-dev

如果openssl拒绝安装,请尝试:

sudo apt-get install libssl-dev

我再次尝试安装tidyverse,没有成功。它仍然在xml2和rvest上遇到麻烦。我用在终端中安装了xml2。

sudo apt-get install libxml2-dev

之后,使用Rstudio安装rvest,并成功安装tidyverse。

这些说明适用于R 4.1.1和R 3.4.4

票数 2
EN

Stack Overflow用户

发布于 2021-08-31 04:16:20

这里的R版本似乎很旧,是3.6版。一堆与tidyverse相关的东西围绕着从3.*到4.*的转换而中断。

如果你遵循这样的过程,它应该会让你走上正确的道路,使用适当的R版本,其余的可能会到位。

https://linuxize.com/post/how-to-install-r-on-ubuntu-20-04/

有时,在linux计算机上,您会因为缺少系统级依赖项而无法安装软件包。这些消息通常是信息性的;它们会告诉您需要什么以及获取它的命令。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68992346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档