本文参考:RHEL 6下源码包安装部署Ansible(luashin)
准备工作:
1、下载安装文件,并将文件上传到安装用户的HOME目录下
安装文件 :https://download.csdn.net/download/zjyklwg/10723090
2、配置好yum源
(1)、python2.7安装
#python -V
Python 2.7.5
版本太老了,升级一下
yum -y install zlib*
yum -y install gcc
yum -y install unzip
yum -y install libffi-devel
yum -y install openssl-devel
yum -y install ncurses-devel
yum -y install gdbm-devel
yum -y install readline-devel
yum -y install sqlite-devel
yum -y install bzip2-devel
cd
tar xvzf Python-2.7.15.tgz
cd Python-2.7.15
./configure --prefix=/usr/local
make
make altinstall
mv /usr/bin/python /usr/bin/python2.7.5
ln -s /usr/local/bin/python2.7 /usr/bin/python
ln -s /usr/lib64/python2.7/site-packages/selinux /usr/local/lib/python2.7/site-packages/selinu