如何在 Ubuntu 16.04 上安装 openssl 1.0.2 和默认 openssl(1.1.1)?

如何在 Ubuntu 16.04 上安装 openssl 1.0.2 和默认 openssl(1.1.1)?

P4Python 无法在 Ubuntu 16.04 上运行,因为该发行版附带OpenSSL 1.1.0g.(细节)。我正在尝试使用从源代码构建 P4Python --ssl path/to/openssl1.0。我需要安装OpenSSL 1.0.2以及默认版本的 OpenSSL。(不确定降级 OpenSSL 是否会导致问题)。如何安装旧版本的 OpenSSL,以便可以将其用于构建 P4Python?

答案1

本文有完整答案:

稍微重新格式化:

cURL 方法


# (Install cURL library)  
sudo apt-get install php5-curl 

# (Install compiling library Make)  
sudo apt-get install make 

# (single command that will download latest binaries, extract them, cd into the directory, compile configuration and then install the files)  
curl https://www.openssl.org/source/openssl-1.0.2l.tar.gz | tar xz && cd openssl-1.0.2l && sudo ./config && sudo make && sudo make install 

# (This will create a sym link to the new binaries)  
sudo ln -sf /usr/local/ssl/bin/openssl `which openssl` 

# (Used to check the version of the Current OpenSSL binaries)  
openssl version -v 

wget 方法

# (Install compiling library Make)  
sudo apt-get install make 

# (Download the latest OpenSSL 1.0.2g binaries)  
wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz 

# (Extract the tar ball to the local directory)  
tar -xzvf openssl-1.0.2l.tar.gz 

# (Enter extracted OpenSSL directory)  
cd openssl-1.0.2l 

#  (Configure binaries for compiling)  
sudo ./config

# (install configured binaries)  
sudo make install 

# (This will create a sym link to the new binaries)  
sudo ln -sf /usr/local/ssl/bin/openssl `which openssl` 

# (Used to check the version of the Current OpenSSL binaries)  
openssl version -v 

答案2

您可以尝试以下操作:

sudo apt-get install -y --allow-downgrades openssl1.0=1.0.2n-1ubuntu5.1 
echo "export OPENSSL_DIR=/usr/lib/ssl1.0/" >> ~/.bashrc

相关内容