无法在 manjaro 上的 R 中安装任何包

问题描述 投票:0回答:1

我一直在尝试通过我的 Manjaro 机器上的终端在 R 中安装一些包,但我发现无论我尝试安装什么包,每次我都会遇到同样的错误。

> install.packages("ggplot2")
Warning in install.packages("ggplot2") :
  'lib = "/usr/lib/R/library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) yes
Would you like to create a personal library
‘/home/"username"/R/x86_64-pc-linux-gnu-library/4.2’
to install packages into? (yes/No/cancel) yes
--- Please select a CRAN mirror for use in this session ---
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/usr/lib/R/library/tcltk/libs/tcltk.so':
  libtk8.6.so: cannot open shared object file: No such file or directory
r install.packages manjaro
1个回答
0
投票

这个错误提示用户没有必要的权限写入安装R包的库目录。解决此问题的一个简单方法是创建一个您拥有并拥有完全权限的个人图书馆。当提示使用个人图书馆时,键入“是”。当提示创建库时,再次键入“是”。然后,系统会提示您选择一个 CRAN 镜像。选择一个镜像并继续安装包。如果安装仍然失败,可能是因为缺少依赖项。在这种情况下,错误消息表明您可能缺少“libtk8.6.so”库。尝试使用系统的包管理器安装这个库,然后再次尝试安装包。

© www.soinside.com 2019 - 2024. All rights reserved.