make: *** /lib/modules/3.10.0-327.2.el7.x86_64/build: No such file or directory. Stop

时间:2022-11-02 12:12:11

problem:

make: *** /lib/modules/3.10.0-327.2.el7.x86_64/build: No such file or directory. Stop

Reason:

The kernel head files are missing for the current kernel.


How I solved it:

find current kernel: uname -r

yum install kernel-devel-$(uname -r)

you may not find it...just google that version of kernel-devel-... download the rpm file, and do

rpm -i kernel-devel-xxxx.rpm


The link maybe is not mate your kernel version.

  1. cd to /lib/modules/3.10.0-327.2.el7.x86_64/    Delete the wrong link.

    $ rm build`
    
  2. Use $ uname -r to check the kernel version

  3. Build new link mate your kernel version.

    $ ln -s /usr/src/kernels/3.10.0-327.2.el7.x86_64/ build