安装乘客时出错:乘客的乘客-6 需要 libruby.so.2.5,但无法安装任何提供程序

安装乘客时出错:乘客的乘客-6 需要 libruby.so.2.5,但无法安装任何提供程序

本来我想更新ruby2.5ruby2.7

但是passenger更新受阻(yum 抛出错误),所以我已删除 passenger并随后ruby2.5进行安装。ruby2.7

ruby2.7然后安装成功了,但是现在我无法重新安装passenger. (试图智胜错误只是转移了它)

$ sudo yum -y install passenger

passenger                                                                        2.7 kB/s | 833  B     00:00
Error:
 Problem: conflicting requests
  - package passenger-6.0.4-3.el8.x86_64 from epel requires libruby.so.2.5()(64bit), but none of the providers can be installed
  - package passenger-6.0.10-1.el8.x86_64 from passenger requires libruby.so.2.5()(64bit), but none of the providers can be installed
    ...
  - package passenger-6.0.18-1.el8.x86_64 from passenger requires libruby.so.2.5()(64bit), but none of the providers can be installed
  - package passenger-6.0.19-1.el8.x86_64 from passenger requires libruby.so.2.5()(64bit), but none of the providers can be installed
    ...
  - package passenger-6.0.9-1.el8.x86_64 from passenger requires libruby.so.2.5()(64bit), but none of the providers can be installed
  - package ruby-libs-2.5.5-105.module_el8.1.0+214+9be47fd7.x86_64 from appstream is filtered out by modular filtering
    ...
  - package ruby-libs-2.5.9-111.module_el8+475+35a6c697.x86_64 from appstream is filtered out by modular filtering
(try to add '--skip-broken' to skip uninstallable packages)

我删除passenger-repo并重新安装它但没有成功,关于官方乘客文件

对我来说,似乎有些事情仍然坚持 ruby 2.5这里。

谁能帮我?


我的存储库:

appstream                    CentOS Stream 8 - AppStream
baseos                       CentOS Stream 8 - BaseOS
docker-ce-stable             Docker CE Stable - x86_64
docker-ce-test               Docker CE Test - x86_64
epel                         Extra Packages for Enterprise Linux 8 - x86_64
epel-next                    Extra Packages for Enterprise Linux 8 - Next - x86_64
extras                       CentOS Stream 8 - Extras
extras-common                CentOS Stream 8 - Extras common packages
passenger                    passenger
powertools                   CentOS Stream 8 - PowerTools
remi-modular                 Remi's Modular repository for Enterprise Linux 8 - x86_64
remi-safe                    Safe Remi's RPM repository for Enterprise Linux 8 - x86_64

答案1

这是由于 RHEL 8 中引入的一项技术(后来在 CentOS Linux/Stream 8 中可用)称为模块化。它允许发行版在同一个存储库中发布相同软件包的多个版本,并且一次只能对软件包管理器显示一组版本。这可能是您从 ruby​​ 2.5 升级到 2.7 的方式。

root@c8-container:~# dnf module list ruby
Last metadata expiration check: 1:39:02 ago on Tue Jan  2 23:51:04 2024.
CentOS Stream 8 - AppStream
Name    Stream     Profiles     Summary                                               
ruby    2.5 [d]    common [d]   An interpreter of object-oriented scripting language  
ruby    2.6        common [d]   An interpreter of object-oriented scripting language  
ruby    2.7        common [d]   An interpreter of object-oriented scripting language  
ruby    3.0        common [d]   An interpreter of object-oriented scripting language  
ruby    3.1        common       An interpreter of object-oriented scripting language  

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

2.5意味着[d]dnf 默认只会看到来自ruby:2.5模块流的包。来自其他模块流的包会被过滤掉。如果您选择加入其他模块流之一(如)ruby:2.7,dnf 将只会看到这些包并过滤掉其他所有包,包括来自的默认包ruby:2.5

如果您将自己限制在发行版附带的软件包中,它就可以很好地工作,但是当您添加第三方存储库时,它很快就会崩溃,因为您已经启用了多个第三方存储库。模块化有一个严重的设计缺陷,即您只能在同一个构建系统中构建的模块之间建立依赖关系,而非模块化软件包只能依赖于来自默认流的模块化软件包。在这种情况下,这意味着来自 EPEL 或 Passenger 存储库的 Passenger 是针对默认版本的 ruby​​ 2.5 构建的。这就是类似这样的错误消息告诉您的内容:

  - package passenger-6.0.4-3.el8.x86_64 from epel requires libruby.so.2.5()(64bit), but none of the providers can be installed

因为 Passenger 需要 libruby.so.2.5,如果ruby:2.5模块流被过滤掉,Passenger 就无法卸载,这就是错误消息的这一部分告诉您的内容:

  - package ruby-libs-2.5.9-111.module_el8+475+35a6c697.x86_64 from appstream is filtered out by modular filtering

最好的选择是切换回ruby:2.5模块流,以便第三方软件包可以正常工作。您可以通过卸载所有 ruby​​ 软件包、切换到ruby:2.5,然后重新安装所需的 ruby​​ 软件包来执行此操作。

dnf erase ruby\*
dnf module switch-to ruby:2.5
dnf install ruby passenger

相关内容