How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7

ModuleLinux KernelOpensslRedhat

Module Problem Overview


I have RedHat Enterprise Linux Server 7, and I downloaded the linux kernel version 4.12.10 which I am trying to compile but when I execute the following command:

make modules

I get the following error:

scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory

Does anyone have an idea to fix this please ?

Module Solutions


Solution 1 - Module

To fix this problem, you have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.

To install OpenSSL development package on Debian, Ubuntu or their derivatives:

$ sudo apt-get install libssl-dev

To install OpenSSL development package on Fedora, CentOS or RHEL:

$ sudo yum install openssl-devel 

Edit : As @isapir has pointed out, for Fedora version>=22 use the DNF package manager :

dnf install openssl-devel

Solution 2 - Module

For Alpine Linux:

apk add openssl-dev

Solution 3 - Module

On CYGwin, you can install this as a typical package in the first screen. Look for

libssl-devel

Solution 4 - Module

for resolving this issue install:

# yum install openssl openssl-devel

and then try again to do make bzImage.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrainmanView Question on Stackoverflow
Solution 1 - Moduleuser10089632View Answer on Stackoverflow
Solution 2 - ModulecstroeView Answer on Stackoverflow
Solution 3 - ModuleJohn PeurifoyView Answer on Stackoverflow
Solution 4 - ModuleArash ForoughiView Answer on Stackoverflow