1

Hosting: new droplet on Digital Ocean

Operating system: fresh install of CentOS 7.6.1810

Question: I installed OpenSSL 1.1.1 from source using a tutorial but I don't understand what the following 2 lines do. I understand the basics of Linux but I don't know how to read these.

:~# export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
:~# echo "export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64" >> ~/.bashrc

Secondarily when I check the version it returns 1.1.1.

:~# openssl version
:~# OpenSSL 1.1.1  11 Sep 2018

However when I look at what's installed it still shows the old OpenSSL 1.0.2k.

:~# yum list installed | grep openssl
openssl.x86_64                          1:1.0.2k-16.el7_6.1        installed
openssl-devel.x86_64                    1:1.0.2k-16.el7_6.1        @updates
openssl-libs.x86_64                     1:1.0.2k-16.el7_6.1        installed

My sense is that somehow those first two lines are connected to this problem but I can't understand them. I hate to robotically do something without understanding what is going on.

1 Answer 1

1

The ld.so(8) man page explains:

       LD_LIBRARY_PATH
              A  list  of  directories in which to search for ELF libraries at
              execution time.  The items in the list are separated  by  either
              colons  or  semicolons,  and  there  is  no support for escaping
              either separator.

              This variable is ignored in secure-execution mode.

By setting this in your environment, you cause programs you run to search for shared libraries in those directories first. It looks like your tutorial author intends for this to override the system OpenSSL packages with your locally installed OpenSSL version.

5
  • 1
    That was an override, interesting. I'm a non-expert but wouldn't it be better to uninstall or at least disable the old OpenSSL and then replace it with the new OpenSSL rather than override it? I work on front-end and in my world we'd delete code rather than put it in incorrectly and overwrite it later on in the file. But maybe Linux is different. Jun 30, 2019 at 19:24
  • 2
    Everything else on your computer, installed by the system, expects the other version of OpenSSL and probably will crash if you tried to do that. Jul 1, 2019 at 4:22
  • @MichaelHampton.... So, "LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64" command is instructing system to look for share libraries in lib or lib64 folder. What about the libraries of older version of OpenSSL ? where those shared libraries are there in system ? Actually, i am trying to install cURL from source and want to configure the cURL with latest version of OpenSSL (which i installed just now using source files) but cURL is not able to connect to OpenSSL May 3, 2020 at 11:07
  • 1
    @GauravKansal You should ask a new question. This is pretty far away from the original topic of this question. May 3, 2020 at 11:18
  • @MichaelHampton.... Okay.Thanks. Any idea about the location of the libraries of older version of OpenSSL. May 3, 2020 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.