shell 脚本自动安装python3
# /bin/bashcd /optyum groupinstall "Development tools" -yyum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-develwget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xzif [ -f /opt/Python-3.6.6.tar.xz ];then tar -xf Python-3.6.6.tar.xz cd /opt/Python-3.6.6 ./configure --prefix=/usr/local/python3 --enable-optimizations if [ $0 == 0 ];then make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 else echo "./configure 出现错误" fielse echo "下载失败"fi