![无法在 CentOS 中安装 libyaml-devel libffi-devel](https://linux22.com/image/89986/%E6%97%A0%E6%B3%95%E5%9C%A8%20CentOS%20%E4%B8%AD%E5%AE%89%E8%A3%85%20libyaml-devel%20libffi-devel.png)
我正在尝试通过 RVM 安装最新的 ruby。我无法安装 install,因为它需要 libyaml-devel 和 libffi-dev。当我尝试安装它们时,我收到错误消息,没有找到包
[root@dev workspace]# rvm requirements
Checking requirements for redhat.
Enabling optional repository
Username: ^C
User interrupted process.
Installing requirements for redhat.
Installing required packages: libyaml-devel, libffi-devel..
Error running 'requirements_centos_libs_install libyaml-devel libffi-devel',
showing last 15 lines of /usr/local/rvm/log/1467891146/package_install_libyaml-devel_libffi-devel.log
+ __rvm_try_sudo yum install -y libyaml-devel libffi-devel
+ typeset -a command_to_run
+ typeset sudo_path sbin_path missing_paths
+ command_to_run=("$@")
+ (( UID == 0 ))
+ yum install -y libyaml-devel libffi-devel
Failed to set locale, defaulting to C
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
Setting up Install Process
No package libyaml-devel available.
No package libffi-devel available.
Error: Nothing to do
+ return 1
+ return 1
答案1
libyaml-devel
由 CentOS 8 的 PowerTools-repository提供libffi-devel
,默认情况下禁用。
所以一个简单的方法yum --enablerepo=powertools install libyaml-devel libffi-devel
就可以解决问题。
(也许发布其他答案时情况并非如此。)
答案2
你没有运行 CentOS。您正在运行没有订阅的 RHEL6。请联系您的系统管理员以添加订阅,然后您就可以添加软件包。我会不是建议您从某个由 IP 寻址的随机 FTP 服务器安装 CentOS 软件包。您不知道自己得到了什么,也没有检查 RPM GPG 签名。
如果您打算安装 CentOS,也许您应该从CentOS 媒体。
答案3
对于 RHEL6,两者都可以在“rhel-6-server-optional-rpms”存储库中找到,我不建议使用未知的 RPM 源,例如提到的“jsbillings”。
subscription-manager repos --enable rhel-6-server-optional-rpms
答案4
最后通过手动下载 RPM 并安装来安装 libyaml-devel 和 libffi-devel。
您可以找到rpm 在这里
我运行以下命令来下载 rpm
curl ftp://195.220.108.108/linux/centos/6.8/os/x86_64/Packages/libyaml-devel-0.1.3-4.el6_6.x86_64.rpm --output libyaml-devel-0.1.3-4.el6_6.x86_64.rpm
curl ftp://195.220.108.108/linux/centos/6.8/os/x86_64/Packages/libffi-devel-3.0.5-3.2.el6.x86_64.rpm --output libffi-devel-3.0.5-3.2.el6.x86_64.rpm
然后使用安装它们
sudo rpm -Uvh libyaml-devel-0.1.3-11.16.1.x86_64.rpm
sudo rpm -Uvh libffi-devel-3.0.5-3.2.el6.x86_64.rpm