"openssl / ssl.h: no such file or directory" during git installation

Trying to install git on Unix and Linux machines based on the instructions for Installing Git , and it does not work with the error below

make prefix=/usr/local all GIT_VERSION = 1.8.3.4 * new build flags CC credential-store.o In file included from cache.h:4, from credential-store.c:1: git-compat-util.h:221:25: warning: openssl/ssl.h: No such file or directory git-compat-util.h:222:25: warning: openssl/err.h: No such file or directory In file included from credential-store.c:1: cache.h:11:21: warning: openssl/sha.h: No such file or directory cache.h:19:18: warning: zlib.h: No such file or directory In file included from credential-store.c:1: cache.h:21: syntax error before "z_stream" cache.h:21: warning: no semicolon at end of struct or union cache.h:28: syntax error before '}' token cache.h:28: warning: type defaults to `int' in declaration of `git_zstream' cache.h:28: warning: data definition has no type or storage class cache.h:30: syntax error before '*' token cache.h:31: syntax error before '*' token cache.h:32: syntax error before '*' token cache.h:33: syntax error before '*' token cache.h:35: syntax error before '*' token cache.h:36: syntax error before '*' token cache.h:37: syntax error before '*' token cache.h:38: syntax error before '*' token cache.h:39: syntax error before '*' token cache.h:40: syntax error before '*' token cache.h:41: syntax error before '*' token cache.h:42: syntax error before '*' token cache.h:769: syntax error before '*' token make: *** [credential-store.o] Error 1 

I know this is due to missing libraries for openssl, but I can not get these libraries.

I do not have yum / apt-get on my machines to run the following commands:

 $ yum install curl-devel expat-devel gettext-devel \ openssl-devel zlib-devel $ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ libz-dev libssl-dev 

What should I do to get these libraries on these machines. These machines do not have internet access, I can do scp if necessary. Any suggestions.

+13
source share
6 answers

this answer worked fine for me

fooobar.com/questions/42374 / ...

just sudo apt-get install libssl-dev

+16
source

For RHEL and RHEL derivatives such as CentOS systems, installation will solve this problem.

 $ yum install -y openssl-devel 
+7
source

If you do not have access to ready-made packages for the required libraries, you need to resort to a century-old practice before package managers appeared: building libraries locally and the libraries on which they depend, and libraries that they depend on, etc.

In other words, you have a potentially large and complex labyrinth of minting dependencies, which may include portability bug fixes for your platform if the source code does not compile out of the box.

Debian PTS has links to upstream projects for many packages, so you may not need to guess which result to select from the Google results for "openssl source." See http://packages.qa.debian.org/o/openssl.html (the "View Source" link is a good start; the Debian copyright file for each package should also contain an upstream URL, although it may be historical )

also:

If you have a package manager locally (on Debian, this will be the main dpkg ), you can avoid searching and compiling morass and just copy the required hierarchy of dependent packages from a host connected to the Internet; but again, make sure you get the full set of recursive dependencies (everything that your package depends on, in turn, depends on recursively). For instance. https://packages.debian.org/stable/openssl shows which packages the Debian openssl package depends on; in turn, some of them will have a similar list of their own dependencies.

+2
source

If you cannot access yum, apt-get, etc. (For example, on a cluster machine without sudo access), install the new version of openssl locally and manually as follows:

Get the source code, unzip it, go into the directory and create the assembly 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 the assembly for the local destination (make sure it is different from your source directory, do not just use /home/yourdir/openssl-1.0.2r/), do and install:

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

Add the paths to the beans and libraries from the assembly directory to the appropriate variables in your shell configuration file (for example, ~ / .bashrc) and create 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 default directory:

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

Now try reinstalling git, possibly with make distclean.

+1
source

For Ubuntu, I installed openssl and libssl-dev

sudo apt install openssl libssl-dev

After checking the configuration file code, I found that it was looking for "include / openssl / ssl.h" in the predefined paths

You can find it on your system and run the configuration with --with-openssl

For example, if you found ssl.h in /usr/include/openssl/ssl.h, you can run the command below

./configure --with-openssl = / usr /

0
source

Half the answer (covering apt, not yum):

If you add --print-uris to the apt-get command, it will tell you which files it needs and where to download them, you can get these files and dpkg -i them. Or put them in /var/cache/apt/archives and run apt-get (without --print-uris ) and it will find them in the cache and not try to load them.

-1
source

Source: https://habr.com/ru/post/950487/


All Articles