我正在尝试在 AWS Ec2 (Linux) 实例上安装 R 和相关包。这些包因依赖 libsodium 而失败。
R故障
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libsodium was not found. Try installing:
* deb: libsodium-dev (Debian, Ubuntu, etc)
* rpm: libsodium-devel (Fedora, EPEL)
* csw: libsodium_dev (Solaris)
* brew: libsodium (OSX)
If libsodium is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libsodium.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
尝试在 EC2 上安装 libsodium
[ec2-user@ip-xxx R]$ sudo yum install libsodium
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
No package libsodium available.
Error: Nothing to do
如果我提供 libsodium-devel 也一样
[ec2-user@ip-xxx R]$ yum info libsodium-devel
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Error: No matching Packages to list
===编辑====
正如建议的这里我尝试为 RHEL 安装 EPEL (sudo yum install epel-release),它重定向到 amazon-extras,我安装如下
ec2-user@ip-xxx R]$ sudo amazon-linux-extras install epel
Installing epel-release
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-R3.4 amzn2extra-docker amzn2extra-epel
17 metadata files removed
6 sqlite files removed
0 metadata files removed
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
amzn2extra-R3.4 | 3.0 kB 00:00:00
amzn2extra-docker | 3.0 kB 00:00:00
amzn2extra-epel | 3.0 kB 00:00:00
(1/9):
:
(9/9): amzn2-core/2/x86_64/primary_db | 51 MB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================
Package Arch Version Repository Size
==============================================================================
Installing:
epel-release noarch 7-11 amzn2extra-epel 15 k
Transaction Summary
===============================================================================
Install 1 Package
Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-11.noarch 1/1
Verifying : epel-release-7-11.noarch 1/1
Installed:
epel-release.noarch 0:7-11
Complete!
但仍然因“未找到 libsodium”而失败。
[ec2-user@ip-xxx R]$ sudo find / -iname libsodium [ec2-user@ip-xxx R]$
感谢有关如何在 AWS EC2 上安装 libsodium 的任何指示。
问候。
答案1
我在 AWS Linux 2 上成功安装了 libsodium后安装 EPEL:
1.安装EPEL:
sudo amazon-linux-extras install epel
2.安装libsodium:
sudo yum install libsodium-devel.x86_64
(您可以通过运行来搜索确切的包名称yum search libsodium-devel
,在我的例子中给出了实际的包名称:libsodium-devel.x86_64