Installing the latest OpenSSL on Ubuntu 16.04

Technically, I didn't do this on a Linux machine, but my Ubuntu on Windows machine, but hopefully the process proves useful to someone.

Known Prerequisites:
The only requirements I know of are the ones listed in the INSTALL file on the OpenSSL GitHub repo.

  1. Download the repo. I have git installed and configured on my machine, so I used the following command:
    cd ~/Code
    git clone --depth=1 git@github.com:openssl/openssl.git
    cd openssl
  2. Follow the build instructions in the INSTALL file:
    ./config
    make
    make test
    make install
  3. I didn't run into any issues up to this point.
    • It takes maybe 30 minutes to build—I'm guessing because I didn't expect it to take as long as it did. 🤭
  4. Once the make install command has completed, you should have a new openssl binary installed at /usr/local/bin/openssl.
  5. When I ran it, it made the following complaint when I ran openssl version:
    libssl.so.1.1: cannot open shared object file: No such file or directory
  6. To fix this, I followed these instructions I found on StackOverflow:
    cd /lib/x86_64-linux-gnu
    sudo ln -s libssl.so.1.0.0 libssl.so.10
  7. I didn't blindly add the second symlink until I confirmed it was needed. With the libssl library symlinked, it did complain about libcrypto, so I finished following the SO instructions:
    sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10
  8. After this, openssl complained about previous versions of openssl not being installed.
    version `OPENSSL_1_1_2' not found
  9. To fix this, I followed a cue from one of the comments on the SO answer I referenced above:
    sudo apt-get install libssl1.0.0 libssl-dev --reinstall
  10. After that, this is what I get:
    $ /usr/local/bin/openssl version
    OpenSSL 1.1.2-dev xx XXX xxxx

 The xx XXX xxxx admittedly makes me nervous, but it's just the release (build?) date not getting included, so I don't think it's anything to fret over.

This article was updated on 22 November 2018