How to upgrade OpenSSL in CentOS 6.5 / Linux / Unix from source?

前端 未结 11 1376
刺人心
刺人心 2020-12-12 18:13

How do I upgrade OpenSSL in CentOS 6.5?

I have used these commands, but nothings happens:

 cd /usr/src
 wget http://www.openssl.org/source/openssl-1.         


        
11条回答
  •  醉梦人生
    2020-12-12 18:29

    I agree that in 95% of cases, all you need is sudo yum update openssl

    However, if you need a specific version of openssl or specific functionality, which is not in CentOS repository, you probably need to compile from source. The other answers here were incomplete. Below is what worked (CentOS 6.9), although this may introduce incompatibilities with installed software, and will not auto-update the openssl.


    Choose openssl version from https://www.openssl.org/source/

    • At the time of this writing July 1, 2017, the needed version was dated 2017-May-25 13:09:51, openssl-1.1.0f.tar.gz
    • Copy the desired link, and use below, in our case ( https://www.openssl.org/source/openssl-1.1.0f.tar.gz )

    Log-in as root:

    cd /usr/local/src/
    
    # OPTIONALLY CHANGE openssl-1.1.0f.tar.gz to the version which you want
    wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
    
    sha256sum openssl-1.1.0f.tar.gz  #confirm this matches the published hash
    
    tar -zxf openssl-1.1.0f.tar.gz
    
    cd /usr/local/src/openssl-1.1.0f
    
    ./config --prefix=/usr/local --openssldir=/usr/local/openssl
    make
    make test
    make install
    
    export LD_LIBRARY_PATH=/usr/local/lib64
    
    #make export permanent
    echo "export LD_LIBRARY_PATH=/usr/local/lib64" > /etc/profile.d/ld_library_path.sh
    chmod ugo+x /etc/profile.d/ld_library_path.sh
    
    openssl version  #confirm it works
    
    #recommended reboot here
    
    openssl version  #confirm it works after reboot
    

提交回复
热议问题