우리는 최신 버전의 pip 설치를 시도했습니다(rhel 7.6 서버와 Python 2.7이 있습니다).
yum install python27-python-pip
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
rhel-7-server-rpms | 3.5 kB 00:00:00
rhel-server-rhscl-7-rpms | 3.4 kB 00:00:00
(1/6): rhel-7-server-rpms/7Server/x86_64/group | 631 kB 00:00:00
(2/6): rhel-7-server-rpms/7Server/x86_64/updateinfo | 3.9 MB 00:00:01
(3/6): rhel-server-rhscl-7-rpms/7Server/x86_64/group | 124 B 00:00:00
(4/6): rhel-server-rhscl-7-rpms/7Server/x86_64/updateinfo | 1.1 MB 00:00:00
(5/6): rhel-server-rhscl-7-rpms/7Server/x86_64/primary_db | 6.0 MB 00:00:07
(6/6): rhel-7-server-rpms/7Server/x86_64/primary_db | 75 MB 00:00:11
Resolving Dependencies
--> Running transaction check
---> Package python27-python-pip.noarch 0:8.1.2-3.el7 will be installed
--> Processing Dependency: python27-python(abi) = 2.7 for package: python27-python-pip-8.1.2-3.el7.noarch
--> Processing Dependency: /opt/rh/python27/root/usr/bin/python2 for package: python27-python-pip-8.1.2-3.el7.noarch
--> Processing Dependency: python27-python-setuptools for package: python27-python-pip-8.1.2-3.el7.noarch
--> Processing Dependency: python27-runtime for package: python27-python-pip-8.1.2-3.el7.noarch
--> Running transaction check
---> Package python27-python.x86_64 0:2.7.17-2.el7 will be installed
--> Processing Dependency: python27-python-libs(x86-64) = 2.7.17-2.el7 for package: python27-python-2.7.17-2.el7.x86_64
---> Package python27-python-setuptools.noarch 0:0.9.8-7.el7 will be installed
---> Package python27-runtime.x86_64 0:1.1-26.1.el7 will be installed
--> Running transaction check
---> Package python27-python-libs.x86_64 0:2.7.17-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================
Installing:
python27-python-pip noarch 8.1.2-3.el7 rhel-server-rhscl-7-rpms 1.7 M
Installing for dependencies:
python27-python x86_64 2.7.17-2.el7 rhel-server-rhscl-7-rpms 87 k
python27-python-libs x86_64 2.7.17-2.el7 rhel-server-rhscl-7-rpms 5.8 M
python27-python-setuptools noarch 0.9.8-7.el7 rhel-server-rhscl-7-rpms 400 k
python27-runtime x86_64 1.1-26.1.el7 rhel-server-rhscl-7-rpms 1.1 M
Transaction Summary
=============================================================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 9.1 M
Installed size: 34 M
Is this ok [y/d/N]: n
yum은 rhel repo에서 아주 오래된 버전 8.1.x를 다운로드했기 때문에
그런 다음 epel repo에서 다음과 같이 시도합니다.
yum install python-pip
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
epel/x86_64/metalink | 22 kB 00:00:00
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 95 kB 00:00:00
epel/x86_64/updateinfo FAILED
https://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/7/x86_64/repodata/26aa3fe31b7a3b4fd3c1865e5a8635f296b1a9c3591a936744c4226a7b170089-updateinfo.xml.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
(2/3): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(3/3): epel/x86_64/primary_db | 6.9 MB 00:00:11
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-14.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================
Installing:
python2-pip noarch 8.1.2-14.el7 epel 1.7 M
Transaction Summary
=============================================================================================================================================================================================
Install 1 Package
Total download size: 1.7 M
Installed size: 7.2 M
Is this ok [y/d/N]: n
하지만 epel
저장소에는 아주 오래된 pip 버전도 있습니다. 8.1.2
그렇다면 내 프로그램에 문제가 있는 걸까요?
그렇다면 최신 pip 버전을 설치하는 방법은 무엇입니까?
답변1
당신은 잘못한 것이 없습니다. 8.1.2는 EPEL 7 저장소에서 사용할 수 있는 최신 버전의 pip입니다. RHEL/CentOS 7은 일반적으로 새 버전의 소프트웨어를 제공하지 않고 버그 수정만 제공하며 EPEL도 마찬가지입니다. 일부 CVE 수정 사항 및 기타 최신 패치가 있습니다.pip EPEL 저장소그래서 나는 그것이 적극적으로 유지되고 있고 사용하기에 안전하다고 가정합니다.
답변2
8.1.2는 RHEL 7.6(및 RHEL 7.8)용 RHEL 리포지토리에서 사용할 수 있는 최신 버전이며 해당 Python 버전은 2.7입니다. 버전 19.3.1을 사용할 수 있지만 Python 3.8용입니다. 필요한 RHEL 리포지토리를 활성화하고 yum
다음 명령을 사용하여 패키지를 검색하면 사용 가능한 것을 확인할 수 있습니다.
subscription-manager repos enable rhel*
yum list available | grep python-pip
그러면 Python 2.7용 8.1.2 및 Python 3.8용 19.3.1을 포함하여 사용 가능한 모든 Python 버전의 최신 버전이 표시됩니다.
버전 21.x를 원하는 경우 3.8과 같은 더 높은 버전의 Python을 설치해야 합니다. Python 2.7은 더 이상 지원되지 않으며 더 이상 업데이트를 받지 않습니다.