Article Directory
1. Update OpenSSL
1. Install dependencies, download the installation package
yum install -y gcc libffi-devel zlib* openssl-devel libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make perl
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1a.tar.gz
2. Decompress and compile
tar -zxvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a/
./config --prefix=/usr/local/openssl
make && make install
3. Configuration
#删除原有的openssl
rm -rf /usr/bin/openssl
#给新安装的openss创建软连接
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
#写入openssl库文件的搜索路径
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
#使修改后的/etc/ld.so.conf生效
ldconfig -v
4. Delete temporary files
cd ..
rm -rf openssl-1.1.1a/ openssl-1.1.1a.tar.gz
5. Check the version, if it is still an old version, just reconnect the session
#查看openssl版本
openssl version
2. Install Python
The following is a one-click script to install Python3:
# 安装python3一键脚本
# 适用系统 CentOS
# Python3版本:3.11.0
# 安装编译Python3源文件所需的编译环境
yum install -y gcc
yum install -y zlib*
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
# 下载并解压Python文件
wget http://cdn.npm.taobao.org/dist/python/3.11.0/Python-3.11.0.tgz
tar -zxvf Python-3.11.0.tgz
cd Python-3.11.0/
# 指定安装目录
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
# 编译并安装
make
make install
# 建立软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
# 清理文件
cd ..
rm -rf Python-3.11.0/ Python-3.11.0.tgz
echo "安装完成."
echo "安装目录:/user/local/pyhton3"
Tip: For more content, please visit Clang's Blog: https://www.clang.asia