RHELにPython 2.7をインストールできません

RHELにPython 2.7をインストールできません

RHEL8にPython 2.7をインストールできませんCentos7リポジトリの外にPythonパッケージが見つからないという事実のためにすでに苦しんでいますが、インストールしようとすると依存関係が壊れています。

sudo dnf install python

私にしてください:

Last metadata expiration check: 0:09:54 ago on Thu 05 Aug 2021 09:35:23 PM CDT.
Error: 
 Problem: package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libcrypto.so.1.1()(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libcrypto.so.1.1(OPENSSL_1_1_0)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1()(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1(OPENSSL_1_1_0)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1(OPENSSL_1_1_1)(64bit), but none of the providers can be installed
  - cannot install both openssl-libs-1:1.0.2k-19.el7.x86_64 and openssl-libs-1:1.1.1g-15.el8_3.x86_64
  - problem with installed package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10()(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(libcrypto.so.10)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libssl.so.10()(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libssl.so.10(libssl.so.10)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(OPENSSL_1.0.2)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.6-95.el7.centos.x86_64 requires httpd = 2.4.6-95.el7.centos, but none of the providers can be installed
  - package python-2.7.5-89.el7.x86_64 requires libpython2.7.so.1.0()(64bit), but none of the providers can be installed
  - package python-2.7.5-89.el7.x86_64 requires python-libs(x86-64) = 2.7.5-89.el7, but none of the providers can be installed
  - package mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64 conflicts with httpd < 2.4.25-8 provided by httpd-2.4.6-95.el7.centos.x86_64
  - conflicting requests
  - problem with installed package mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

試してみると、sudo dnf install python --allowerasing 次のようになります。

Last metadata expiration check: 0:22:11 ago on Thu 05 Aug 2021 09:35:23 PM CDT.
Error: 
 Problem: The operation would result in removing the following protected packages: dnf
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

良くないようです。

sudo dnf install python --nobest --skip-broken

それから:

Last metadata expiration check: 0:11:50 ago on Thu 05 Aug 2021 09:35:23 PM CDT.
Dependencies resolved.

 Problem: package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libcrypto.so.1.1()(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libcrypto.so.1.1(OPENSSL_1_1_0)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1()(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1(OPENSSL_1_1_0)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 requires libssl.so.1.1(OPENSSL_1_1_1)(64bit), but none of the providers can be installed
  - cannot install both openssl-libs-1:1.0.2k-19.el7.x86_64 and openssl-libs-1:1.1.1g-15.el8_3.x86_64
  - problem with installed package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10()(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(libcrypto.so.10)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libssl.so.10()(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libssl.so.10(libssl.so.10)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit), but none of the providers can be installed
  - package python-libs-2.7.5-89.el7.x86_64 requires libcrypto.so.10(OPENSSL_1.0.2)(64bit), but none of the providers can be installed
  - package mod_ssl-1:2.4.6-95.el7.centos.x86_64 requires httpd = 2.4.6-95.el7.centos, but none of the providers can be installed
  - package python-2.7.5-89.el7.x86_64 requires libpython2.7.so.1.0()(64bit), but none of the providers can be installed
  - package python-2.7.5-89.el7.x86_64 requires python-libs(x86-64) = 2.7.5-89.el7, but none of the providers can be installed
  - package mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64 conflicts with httpd < 2.4.25-8 provided by httpd-2.4.6-95.el7.centos.x86_64
  - conflicting requests
  - problem with installed package mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64
==================================================================================================================================
 Package                        Arch                     Version                                  Repository                 Size
==================================================================================================================================
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 httpd                          x86_64                   2.4.6-95.el7.centos                      centos7                   2.7 M
 openssl-libs                   x86_64                   1:1.0.2k-19.el7                          centos7                   1.2 M
Skipping packages with broken dependencies:
 mod_ssl                        x86_64                   1:2.4.6-95.el7.centos                    centos7                   114 k
 python                         x86_64                   2.7.5-89.el7                             centos7                    96 k
 python-libs                    x86_64                   2.7.5-89.el7                             centos7                   5.6 M

Transaction Summary
==================================================================================================================================
Skip  5 Packages

Nothing to do.
Complete!

もちろん、Pythonは生成されません。私は何をすべきかわかりません。 Pythonをインストールするための他のオプションはありますか? (実行しようとしている実行可能ファイル/スクリプトがPythonで書かれていてpythonをpython3にエイリアスを指定すると、あらゆる種類のエラーが発生するため、python3ではなくpythonが必要です。)依存関係悪夢にならないPython 2.7用rpmパッケージはありますか? ?

答え1

Python 2.7の例RHEL 8 AppStreamリポジトリで利用可能(パックpython2)。 RHEL / CentOSのさまざまなメジャーバージョンのリポジトリをマージしないでください。これはサポートされておらず、見てわかるように不可能です。

# dnf info python2
Available Packages
Name         : python2
Version      : 2.7.18
Release      : 6.module_el8.5.0+772+8dae0bfd
Architecture : x86_64
Size         : 109 k
Source       : python2-2.7.18-6.module_el8.5.0+772+8dae0bfd.src.rpm
Repository   : appstream
Summary      : An interpreted, interactive, object-oriented programming language
...

Python 2は正式にサポートされています。2020年終了Red Hatはセキュリティアップデートを提供します2024年までのみ

関連情報