一、下载安装包,然后进行升级部署
[[email protected] tmp]# tar zxvf Python-2.7.3.tgz [[email protected] Python-2.7.3]# ./configure && make && make install [[email protected] Python-2.7.3]# which python /usr/local/bin/python [[email protected] Python-2.7.3]# ln -sf /usr/local/bin/python /usr/bin/python [[email protected] Python-2.7.3]# python -V Python 2.7.3
二、处理升级后,yum的情况
由于Python升级后,看下原有yum是否还能正常使用
[[email protected] Python-2.7.3]# yum clean all There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It‘s possible that the above module doesn‘t match the current version of Python, which is: 2.7.3 (default, Dec 17 2013, 17:33:06) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] If you cannot solve this problem yourself, please go to the yum faq at: http://wiki.linux.duke.edu/YumFaq
三、修改yum配置文件
[[email protected] Python-2.7.3]# vim /usr/bin/yum 将“#!/usr/bin/python”改为“#!/usr/bin/python2.4” [[email protected] Python-2.7.3]# yum clean all Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Cleaning up Everything
时间: 2024-11-03 22:24:25