Search code examples
pythonpython-2.7centos7python-2.6lxc

Need to update my Python version to 2.7 in my lxc container


I couldn't remove 2.6 Python which is already installed

Because if I remove then the system is breaking down.

If I install 2.7 and tried to see python version in the base (rpm -q --provides python | grep abi)

python(abi) = 2.6 python-abi = 2.6

I tried to reinstall the epel-release. Still no luck. (epel release 6.8) Tried to see my system is upto date. All good.

What I can do to change it to 2.7.


Solution

  • It sounds like you are actually on centos 6 and not centos 7 since centos 7 comes with python 2.7.6. In any case, if you want python 2.7 on centos 6, the recommended way is to build it from source and then install it using altinstall so that python 2.7 can run alongside python 2.6. You can also install python 2.7 using the IUS repository and then installing using yum -y install python27. Good luck!