“openssl/ssl.h: No such file or directory” during Installation of Git

前端 未结 6 1926
心在旅途
心在旅途 2020-12-30 23:31

Trying to install git on the Unix and Linux machines based on the instructions on Installing Git blog, and it is failing with the below error

make prefix=/u         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 00:25

    If you can't access yum, apt-get etc (such as being on a cluster machine with no sudo access), install a new version of openssl locally and manually as follows:

    Get the source code, unpack it, enter the directory and make a build directory (very important):

    wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz
    tar -xvzf openssl-1.0.2r.tar.gz
    cd openssl-1.0.2r
    mkdir builddir
    

    Configure to your local build destination (make sure its different to your source directory, don't use just /home/yourdir/openssl-1.0.2r/), make and install:

    ./config --prefix=/home/yourdir/openssl-1.0.2r/builddir --openssldir=/home/yourdir/openssl-1.0.2r/builddir
    make
    make install
    

    Add the bin and library paths from the build directory to the appropriate variables in your your shell config file (i.e. ~/.bashrc), and source it:

    export PATH=/home/yourdir/openssl-1.0.2r/builddir/bin:$PATH
    LD_LIBRARY_PATH="/your/other/dirs/libs:/home/yourdir/openssl-1.0.2r/builddir/lib:"
    source ~/.bashrc
    

    OpenSSL should now be in your new directory by default:

    which openssl
    > /home/yourdir/openssl-1.0.2r/builddir/bin/openssl
    

    Now try and reinstall git, perhaps with make distclean.

提交回复
热议问题