I use Ubuntu 18.04. It was shipped with OpenSSL 1.1.0g . I tried to link manually compiled Python to a manually compiled OpenSSL1.1.1a but things does not seem to work well. When I now run Python it is automatically linked to OpenSSL1.1.1a. I want to revert this. I want to restore OpenSSL1.1.0g as the default library for my system and my system's installed python. When I check my system's OpenSSL version I get:
OpenSSL 1.1.0g 2 Nov 2017 (Library: OpenSSL 1.1.1a 20 Nov 2018)
When I check:
whereis openssl
I get:
openssl: /usr/bin/openssl /usr/include/openssl /usr/local/openssl /usr/local/openssl/bin/openssl /usr/share/man/man1/openssl.1ssl.gz
How can I remove OpenSSL 1.1.1a and just leave the system's OpenSSL 1.1.0g? How can I make Python linked to OpenSSL 1.1.0g? Any Python is linked to OpenSSL 1.1.1a now.
EDIT:
The command I used to compile python and openssl is similar to (except different versions):
# new openssl install
curl https://www.openssl.org/source/openssl-1.0.2g.tar.gz | tar xz && cd openssl-1.0.2g && ./config shared --prefix=/usr/local/ && make && make install
# Python install script
export LDFLAGS="-L/usr/local/lib/"
export LD_LIBRARY_PATH="/usr/local/lib/"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/openssl"
apt-get update
apt-get install build-essential checkinstall -y
apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
cd /home/web/
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz | tar xzf Python-2.7.11.tgz && cd Python-2.7.11
./configure --prefix=/usr/local/
make altinstall
First you need to uninstall the manually compiled version of OpenSSL 1.1.1a. Assuming you've kept the build directory, this is as simple as running
make uninstall
in that folder. After successfully completing that, you need to reinstall the Ubuntu package usingapt-get install --reinstall openssl
.