12

P4Python does not work on Ubuntu 16.04 since the distribution comes with OpenSSL 1.1.0g.(details). I am trying to build P4Python from source using --ssl path/to/openssl1.0. I need to install OpenSSL 1.0.2 along with the default version of OpenSSL. (Not sure if something would break if I downgrade OpenSSL). How do I install the older version of OpenSSL so that I can just use it for building P4Python?

Cadoiz
  • 278

2 Answers2

9

This article has a complete answer:

Reformatted slightly:

cURL Method


# (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 method

# (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

Cadoiz
  • 278
monaye
  • 91
1

You can try the following:

sudo apt-get install -y --allow-downgrades openssl1.0=1.0.2n-1ubuntu5.1 
echo "export OPENSSL_DIR=/usr/lib/ssl1.0/" >> ~/.bashrc
russoue
  • 141
  • 2
    It is not safe to downgrade OpenSSL to a 1.0.x version because many things will fail to build or operate properly. If you need a different OpenSSL, I would suggest that you use a VM or container of the older Ubuntu with the older OpenSSL to do this, rather than downgrade your OpenSSL in this manner. – Thomas Ward Oct 04 '18 at 13:49
  • E: Unable to locate package openssl1.0 E: Couldn't find any package by glob 'openssl1.0' E: Couldn't find any package by regex 'openssl1.0' – KD.S.T. Oct 15 '22 at 09:09