This script is primarily for python2.6 upgrade to python2.10, and resolves the issue of not using Yum after upgrade. Added the Ipython feature
#########################
#!/bin/bash
Path= "/home/tools"
if [!-D $path];then
mkdir $path
Else
RM-RF $path && mkdir $path
Fi
CD $path
Yum-y Install automake gcc gcc-c++ readline-devel
wget--no-check-certificate https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
If [$?-eq 0];then
Tar xvf python-2.7.10.tgz
Fi
CD Python-2.7.10 &&/configure--with-zlib && make all && make install && make clean & ;& make Distclean
If [$?-eq 0];then
Rm-rf/usr/bin/python
Ln-s/usr/local/bin/python2.7/usr/bin/python
Fi
Sed-i ' 1s/$/&2.6/g '/usr/bin/yum
wget--no-check-certificate https://pypi.python.org/packages/source/i/ipython/ipython-3.1.0.tar.gz
If [$?-eq 0];then
Tar zxvf ipython-3.1.0.tar.gz
Fi
CD ipython-3.1.0 && python setup.py install
#install Setuptools
CD $path
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-19.2.tar.gz
If [$?-eq 0];then
TAR-ZXF setuptools-19.2.tar.gz
Fi
CD setuptools-19.2
Python setup.py Install
#install pip
CD $path
wget http://pypi.python.org/packages/source/p/pip/pip-8.1.1.tar.gz
If [$?-eq 0];then
TAR-ZXF pip-8.1.1.tar.gz
Fi
CD pip-8.1.1
Python setup.py Install
Pip Install Supervisor
Pip Install Uwsgi
Pip Install ansible==1.9.4
Pip Install django==1.8.3
Pip Install Django-users2
Pip Install Mysql-python
Pip Install Rpyc
This article is from the "operation and maintenance of life" blog, please make sure to keep this source http://jinyan2049.blog.51cto.com/881440/1789434
Python Automatic Update script