I ran the following command:
sudo apt-get install --only-upgrade openssl
and the output was:
openssl is already the newest version (1.1.0g-2ubuntu4.1).
However, when I type openssl version -a
into the terminal, the output is:
OpenSSL 1.0.2o 27 Mar 2018
built on: reproducible build, date unspecified
platform: linux-x86_64
options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: /tmp/build/80754af9/openssl_1522162531585/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/home/vedantroy/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/openssl_1522162531585/work=/usr/local/src/conda/openssl-1.0.2o -fdebug-prefix-map=/home/vedantroy/anaconda3=/usr/local/src/conda-prefix -Wa,--noexecstack -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/home/vedantroy/anaconda3/ssl"
Furthermore, typing which openssl
outputs: /home/vedantroy/anaconda3/bin/openssl
.
It seems my system is using the conda installation of "openssl" instead of the one installed by apt-get
. How do I force my system to use the version of "openssl" that is installed by apt-get
?
The
openssl
package installs an executable file calledopenssl
as/usr/bin/openssl
(seedpkg -L openssl
).You have
openssl
installed as/home/vedantroy/anaconda3/bin/openssl
.The directory
/home/vedantroy/anaconda3/bin
occurs in$PATH
before/usr/bin
appears.Your
$SHELL
picks the firstopenssl
it sees.You have several choices:
$PATH
. However, if there are any other system binaries Anaconda wants to override, this will screw that up./home/vedantroy/anaconda3/bin
, sochmod -x /home/vedantroy/anaconda3/bin/openssl;rehash
will let you use/usr/bin/openssl
.alias openssl="/usr/bin/openssl"
to your~/.bashrc
. WIll only work for shells.In your case I suggest creating an alias to
apt
installed version ofopenssl
:Put your alias somewhere which it gets sourced automatically like:
.bashrc
.You can also run it directly:
Or change the
PATH
environment variable, which can't be a good option in your case because you are actually using Anaconda.Whenever you want to use Anaconda version then run one of these:
Conda may be active by default in your shell, often the case for an anaconda installation on Ubuntu. There may be
(base)
at the beginning of your shell prompt.Simply running
conda deactivate
may fix the issue. It did for me.Given the previous answers I tried the following things to resolve the issue.
Adding an
alias
in.bashrc
didn't work since the conda openssl was picked every time the.bashrc
file wassourced
. Still haven't figured out why that happened.Adding
/usr/bin/openssl
before anaconda in$PATH
environment variable didn't work since it requires to specify the wholebin
directory in$PATH
not just the executableopenssl
. Adding/usr/bin
directory to$PATH
before/home/user/anaconda3/bin
creates another issue for me since it causes thepython
version of system installation to take precedence over the anaconda python version something that I'm avoiding due to my setup.The following solution works if you want to have your default system wide
openssl
being picked up but at the same time using your anaconda python version as your default.In other words stop using anacondas'
openssl
while still maintaining the following env. variableexport PATH="/home/user/anaconda3/bin:$PATH"
The solution (at least for me) involves the use of symbolic links.