5/27/2023 0 Comments Upgrade python centos![]() When the source has been successfully compiled and installed in the temporary directory, we can proceed to making an RPM package for easier distribution. prefix too should be set to /usr/local, not to interfere with the old python version. In order to do that, there are 2 options: compile it in (as we are doing in this case), or manually add /usr/local/lib path to /etc/ld.so.conf and do an /sbin/ldconfig after you install. Important thing to note here is the LDFLAGS parameter for the configure script - as we are installing Python as a shared library, we need to specify, where it will reside. Un-tar it, configure, make and make install it in the dummy directory: $> curl -LO Get the source of the required Python version. Make a dummy directory for temporarily installing the newer Python version: $> mkdir /tmp/installdir To start, we would need a running CentOS/RedHat 6 system, and to set up a few dependencies, to allow compiling of the source code and later preparing an RPM package for easier distribution: $> sudo yum -y install openssl-devel readline-devel \ ![]() ![]() ![]() One of the ways to do that is to compile and install it yourself, or even make an RPM package to be able to repeat it on multiple systems. To work around that, we could set up newer Python version (either from 2.7.* or 3.* branches) in parallel with the default, older 2.6.* version. ![]() In this (CentOS/RedHat 6) case it is not as easy as to just do a yum upgrade python, because newer (2.7 and up) Python versions are incompatible with system utilities that rely on Python 2.6, namely yum itself, so upgrade of the existing version is also not the easiest way. If you still use an older version of CentOS/RedHat, the newest Python version available for it is 2.6, which is not supported anymore by Python team (and many other tools as well). ![]()
0 Comments
Leave a Reply. |