RT
1. 安装libssl1.1
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo apt install libssl1.1_1.1.0g-2ubuntu4_amd64.deb
2. 安装python2.7
sudo apt update && sudo apt upgrade
sudo apt install -y build-essential checkinstall libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar -xvf Python-2.7.18.tgz
cd Python-2.7.18
./configure --enable-optimizations
make
sudo make install
中间依然有异常,所幸安装完成了,python -V可查看当前为2.7.18.剩下的就是python版本配置了.
查看安装位置 whereis python python2 python3
sudo ln -sf /usr/local/bin/python2.7 /usr/bin/python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 2
sudo update-alternatives --config python
参考:
https://github.com/sparklemotion/mechanize/issues/552
apt - Downgrading from OpenSSL 3.0.2 to 1.1.1 - How much can stuff break? - Unix & Linux Stack Exchange
🐕Ubuntu 24.04 上安装libssl1.1 | Wake Me Up When September Ends.
How to install Python 2.7 on Ubuntu 24.04 Noble LTS Linux - Linux Shout
Ubuntu 24.04 LTS安装Python2失败解决_ubuntu 24.04 python2-CSDN博客