下载并安装指定版本openssl
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1s/openssl-1.1.1s.tar.gz
tar xvzf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s/
./config --prefix=/usr/local/openssl111
make && make install
下载python源码包,其他版本修改对应的下载地址即可wget https://www.python.org/ftp/python/3.8.15/Python-3.8.15.tgz
配置安装目录以及openssl环境,需要替换为服务器openssl的安装目录./configure --prefix=/root/python/Python-3.8.15 --with-openssl=/usr/local/openssl111
开始编译并安装make && make install
删除旧软链接rm -rf /usr/bin/pip3 /usr/bin/python3
设置新装的python软链接到user/bin目录ln -s /root/python/Python-3.8.15/bin/pip3.8 /usr/bin/pip3
ln -s /root/python/Python-3.8.15/bin/python3.8 /usr/bin/python3
感谢博主,喝杯咖啡~
还没有人发表评论