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

sof*_*ter 8 openssl

P4Python 不适用于 Ubuntu 16.04,因为该发行版随附 OpenSSL 1.1.0g。(详细信息)。我正在尝试使用 --ssl path/to/openssl1.0 从源代码构建 P4Python。我需要安装 OpenSSL 1.0.2 和默认版本的 OpenSSL。(不确定如果我降级 OpenSSL 会不会有什么问题)。如何安装旧版本的 OpenSSL,以便我可以使用它来构建 P4Python?

小智 9

这篇文章有完整的答案:

稍微重新格式化:

卷曲方法


# (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 
Run Code Online (Sandbox Code Playgroud)

获取方法

# (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 
Run Code Online (Sandbox Code Playgroud)


小智 1

您可以尝试以下操作:

sudo apt-get install -y --allow-downgrades openssl1.0=1.0.2n-1ubuntu5.1 
echo "export OPENSSL_DIR=/usr/lib/ssl1.0/" >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)