Monday, 26 November 2018

Solution : Yum breaks after python upgrade


 Use this method to make both python 3 & 2 work without breaking yum.  


*   Link your default python path to use python3

# ln -s /usr/bin/python3.6 /usr/bin/python

*   Link python2.x as python2

 # ln -s /usr/bin/python2.7 /usr/bin/python2

*   Edit yum binary  and change the python path to the following -

# vi /usr/bin/yum
#!/usr/bin/python2


Test :

-bash-4.3$ /usr/bin/python -V
Python 3.6.4


-bash-4.3$ /usr/bin/python2 -V
Python 2.7.14


-bash-4.3$ yum update # or anything

Note that the first two you can link as per the default you want to use. Keeping yum separate by changing python path is making sure that it uses python 2x always regardless your default setting.  




 


 




No comments:

Post a Comment