5

I installed OpenSSL from source by:

wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz
tar -xvzf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h/
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
sudo make
sudo make install

But when I type openssl on the command line, it says 'The program 'openssl' is currently not installed'. What should I do?

Alex
  • 407
  • 3
  • 7
  • 18
  • See http://unix.stackexchange.com/q/7899/9812, http://unix.stackexchange.com/q/42567/9812, http://unix.stackexchange.com/q/264562/9812. – D.W. Jul 01 '16 at 18:04
  • 4
    I disagree with the proposed duplicate. This isn't about where things should be installed, or even how to install some piece of software (OpenSSL in this particular case). Rather, this is clearly about where the software actually ended up and why it can't be executed by giving just the name of the binary on the command line. – user Jul 01 '16 at 20:27
  • Alex, please note that your commands were to download one version (OpenSSL 1.0.2h, which is current at this time), but unpack, build and install another (1.0.0a, which is outdated, "out of support and should not be used", besides probably having some security-related bugs that have been fixed since 2013). – user Jul 01 '16 at 20:33
  • My bad, I fixed it, – Alex Jul 02 '16 at 08:54
  • 1
    Also see Compilation and Installation on the OpenSSL wiki. It discusses other options, like enable-ec_nistp_64_gcc_128. It also discusses how to add an RPATH. You might be surprised to learn what ldd /usr/local/openssl/bin/openssl returns. It may be using libssl and libcrypto from /usr/lib. –  Nov 09 '16 at 12:17

1 Answers1

8

With your prefix you will need to run something like /usr/local/openssl/bin/openssl.

If you don't want to type the full pathname then you can add the /usr/local/openssl/bin directory to your PATH, or you can symlink the openssl command into /usr/local/bin (assuming that's on your PATH). e.g.

sudo ln -s /usr/local/openssl/bin/openssl /usr/local/bin
  • 4
    Note that either of these, without additional steps, means the OP won't be able to immediately read the man pages (which are likely in /usr/local/openssl/share/man) etc. – user Jul 01 '16 at 20:35
  • @toszter - you should open this as a new question, not as a comment – Stephen Harris Jan 06 '18 at 19:32