Python自动更新脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python自动更新脚本相关的知识,希望对你有一定的参考价值。
本脚本主要针对python2.6升级至python2.10,并且解决了升级后不能使用yum的问题。添加了ipython功能
#########################
#!/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
本文出自 “运维人生” 博客,请务必保留此出处http://jinyan2049.blog.51cto.com/881440/1789434
以上是关于Python自动更新脚本的主要内容,如果未能解决你的问题,请参考以下文章