1

According to yum documentation in centos.org, any packages can be found in all repositories using yum search command.

yum search

This command is used to find any packages containing the specified keyword in the description, summary, packager and package name fields of RPMs in all repositories.

However, I can't find latest Python 3 version with this command. May I know why?

[root@CentOS7 centos]# yum search python | grep 3
python-backports-lzma.x86_64 : Backport of Python 3.3's lzma module
                                           : from Python 3
python-enum34.noarch : Backport of Python 3.4 Enum
python-gssapi.x86_64 : Python Bindings for GSSAPI (RFC 2743/2744 and extensions)
python-ipaddress.noarch : Port of the python 3.3+ ipaddress module to 2.6+
python-six.noarch : Python 2 and 3 compatibility utilities
python-urllib3.noarch : Python HTTP library with thread-safe connection pooling
python-zope-interface.x86_64 : Zope 3 Interface Infrastructure
[root@CentOS7 centos]# 

Second, Python 2.7.5 is currently available in this OS and I would like to install latest Python 3 as well.

[root@CentOS7 centos]# python -V
Python 2.7.5
[root@CentOS7 centos]# 

Why can't I do that with yum install command?

yum install

Used to install the latest version of a package or group of packages. If no package matches the specified package name(s), they are assumed to be a shell glob, and any matches are then installed.

[root@CentOS7 centos]# yum install python3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.usonyx.net
 * extras: centos.usonyx.net
 * updates: centos.usonyx.net
No package python3 available.
Error: Nothing to do
[root@CentOS7 centos]# 

[root@CentOS7 centos]# yum install python-3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.usonyx.net
 * extras: centos.usonyx.net
 * updates: centos.usonyx.net
No package python-3 available.
Error: Nothing to do
[root@CentOS7 centos]# 

Reference:

https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-yum-useful-commands.html

https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7

2

There is no official Python v3.x in the RHEL repositories. RHEL 7 is based on Python 2.7.

However RH provides newer versions of some packages through RH Software Collections:

https://access.redhat.com/support/policy/updates/rhscl

There is Python 3.3 and 3.4.

For CentOS you should be able to use SCL:

https://www.softwarecollections.org/en/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.