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

파이썬 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년까지만.

관련 정보