[root@lxy-zabbix Downloads]# wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz [root@lxy-zabbix Downloads]# tar zxvf Python-3.5.1.tgz cd Python-3.5.1 ./configure --prefix=/usr/local/python3 make make install Installing collected packages: setuptools, pip Successfully installed pip-7.1.2 setuptools-18.2
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python3/bin/python3 /usr/bin/python ln -s /usr/local/python3/bin/pip3 /usr/bin/pip
[root@lxy-zabbix Python-3.5.1]# python Python 3.5.1 (default, Dec 25 2015, 21:48:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
[root@lxy-zabbix ~]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax [root@lxy-zabbix ~]# ll /usr/bin | grep python -rwxr-xr-x. 1 root root 11016 1月 24 2013 abrt-action-analyze-python lrwxrwxrwx 1 root root 24 12月 25 21:53 python -> /opt/python3/bin/python3 lrwxrwxrwx. 1 root root 6 11月 14 07:12 python2 -> python -rwxr-xr-x. 2 root root 9032 10月 13 2012 python2.6 -rwxr-xr-x. 1 root root 1418 10月 13 2012 python2.6-config lrwxrwxrwx. 1 root root 16 11月 14 07:12 python-config -> python2.6-config -rwxr-xr-x. 2 root root 9032 10月 13 2012 python_old
vim /usr/bin/yum [root@lxy-zabbix ~]# yum Loaded plugins: fastestmirror, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. You need to give some command Usage: yum [options] COMMAND List of Commands:
原文:http://www.cnblogs.com/linxingyi/p/5090208.html